aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorPatricia Juarez <patrixd@gmail.com>2013-11-14 13:40:57 +0100
committerTJ VanToll <tj.vantoll@gmail.com>2015-03-03 08:52:21 -0500
commit18e301f4e29c2080e9aa9dac87c00dee137cb6c9 (patch)
tree8e5371952c3b902654d543ebbc8d68803a5c21bf /ui
parent4b017b414f107ed3c1dafc7601b61cbcd76acf61 (diff)
downloadjquery-ui-18e301f4e29c2080e9aa9dac87c00dee137cb6c9.tar.gz
jquery-ui-18e301f4e29c2080e9aa9dac87c00dee137cb6c9.zip
Resizable: Modified to allow jquery objects as handles
Custom handlers did not work as jquery objects (outside the resizable element) Fixes #9658 Closes gh-1445
Diffstat (limited to 'ui')
-rw-r--r--ui/resizable.js17
1 files changed, 8 insertions, 9 deletions
diff --git a/ui/resizable.js b/ui/resizable.js
index d0d500cd1..c4bc36529 100644
--- a/ui/resizable.js
+++ b/ui/resizable.js
@@ -168,7 +168,8 @@ $.widget("ui.resizable", $.ui.mouse, {
nw: ".ui-resizable-nw"
} );
- if (this.handles.constructor === String) {
+ this._handles = $();
+ if ( this.handles.constructor === String ) {
if ( this.handles === "all") {
this.handles = "n,e,s,w,se,sw,ne,nw";
@@ -206,6 +207,9 @@ $.widget("ui.resizable", $.ui.mouse, {
if (this.handles[i].constructor === String) {
this.handles[i] = this.element.children( this.handles[ i ] ).first().show();
+ } else if ( this.handles[ i ].jquery || this.handles[ i ].nodeType ) {
+ this.handles[ i ] = $( this.handles[ i ] );
+ this._on( this.handles[ i ], { "mousedown": that._mouseDown });
}
if (this.elementIsWrapper && this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)) {
@@ -222,21 +226,17 @@ $.widget("ui.resizable", $.ui.mouse, {
target.css(padPos, padWrapper);
this._proportionallyResize();
-
}
- // TODO: What's that good for? There's not anything to be executed left
- if (!$(this.handles[i]).length) {
- continue;
- }
+ this._handles = this._handles.add( this.handles[ i ] );
}
};
// TODO: make renderAxis a prototype function
this._renderAxis(this.element);
- this._handles = $(".ui-resizable-handle", this.element)
- .disableSelection();
+ this._handles = this._handles.add( this.element.find( ".ui-resizable-handle" ) );
+ this._handles.disableSelection();
this._handles.mouseover(function() {
if (!that.resizing) {
@@ -270,7 +270,6 @@ $.widget("ui.resizable", $.ui.mouse, {
}
this._mouseInit();
-
},
_destroy: function() {