Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- alignControl: function(reference, control, align) {
- if (reference !== control) {
- var newValue = {};
- switch (align) {
- case common.align.left :
- case common.align.top :
- case common.align.width :
- newValue[align] = reference.get(align);
- break;
- case common.align.right :
- var rightValue = reference.get('left') + reference.get('width');
- newValue.left = rightValue - control.get('width');
- break;
- case common.align.bottom :
- var bottomValue = reference.get('top') + reference.get('height');
- newValue.top = bottomValue - control.get('height');
- break;
- }
- control.set(newValue, {internal: true});
- return true;
- }
- return false;
- },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement