Skip to content

Commit a73d061

Browse files
Update jquery.ui.rotatable.js
1 parent df5c9f0 commit a73d061

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

jquery.ui.rotatable.js

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
* Compatible with other jQuery UI widgets included Draggable and Resizable
1212
* Compatible with Dave Furfero's jQuery UI Touch Punch
1313
* All angles in degrees
14-
* AlsoRotate extension
14+
* "alsoRotate" extension (under construction)
15+
* "animate" extension (under construction)
1516
*
1617
* Usages:
1718
* $('#foo .bar').rotatable();
@@ -289,6 +290,11 @@ $.widget('ui.rotatable', $.ui.mouse, {
289290
jqHandle.appendTo(this.element);
290291
this._disableSelection(jqHandle);
291292
}
293+
//alert('top:' + jqHandle.css('top') + ' right:' + jqHandle.css('right') + ' bottom:' + jqHandle.css('bottom') + ' left:' + jqHandle.css('left'));
294+
var top = jqHandle.css('top');
295+
var right = jqHandle.css('right');
296+
var bottom = jqHandle.css('bottom');
297+
var left = jqHandle.css('left');
292298
if (jqHandle.css('position') !== 'absolute') {
293299
jqHandle.css('position', 'absolute');
294300
}
@@ -298,6 +304,12 @@ $.widget('ui.rotatable', $.ui.mouse, {
298304
if (jqHandle.height() < 1) {
299305
jqHandle.height(9);
300306
}
307+
if (top === 'auto' && bottom === 'auto') {
308+
jqHandle.css('top', '0px');
309+
}
310+
if (left === 'auto' && right === 'auto') {
311+
jqHandle.css('left', '0px');
312+
}
301313
if (jqHandle.css('cursor') === 'auto') {
302314
jqHandle.css('cursor', 'grab');
303315
}
@@ -483,6 +495,7 @@ $.ui.plugin.add('rotatable', 'alsoRotate', {
483495
$(o.alsoRotate).each(function () {
484496
var element = $(this);
485497
element.data('ui-rotatable-alsorotate', {});
498+
// todo: complete here
486499
});
487500
},
488501

@@ -491,6 +504,7 @@ $.ui.plugin.add('rotatable', 'alsoRotate', {
491504
$(o.alsoRotate).each(function () {
492505
var element = $(this);
493506
var start = element.data('ui-rotatable-alsorotate');
507+
// todo: complete here
494508
});
495509
},
496510

@@ -500,6 +514,14 @@ $.ui.plugin.add('rotatable', 'alsoRotate', {
500514

501515
});
502516

517+
$.ui.plugin.add('rotatable', 'animate', {
518+
519+
stop: function () {
520+
// todo: complete here
521+
}
522+
523+
});
524+
503525
// /Rotatable Extensions
504526

505527
var widgetsRotatable = $.ui.rotatable;

0 commit comments

Comments
 (0)