Advertisement
Guest User

Untitled

a guest
Apr 1st, 2015
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. alignControl: function(reference, control, align) {
  2.                 if (reference !== control) {
  3.                     var newValue = {};
  4.                     switch (align) {
  5.                         case common.align.left :
  6.                         case common.align.top :
  7.                         case common.align.width :
  8.                             newValue[align] = reference.get(align);
  9.                             break;
  10.                         case common.align.right :
  11.                             var rightValue = reference.get('left') + reference.get('width');
  12.                             newValue.left = rightValue - control.get('width');
  13.                             break;
  14.                         case common.align.bottom :
  15.                             var bottomValue = reference.get('top') + reference.get('height');
  16.                             newValue.top  = bottomValue - control.get('height');
  17.                             break;
  18.                     }
  19.                     control.set(newValue, {internal: true});
  20.                     return true;
  21.                 }
  22.                 return false;
  23.             },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement