Add sortable back in to the jquery-ui bundle (bug 688473)
This commit is contained in:
Родитель
79b5c821d3
Коммит
5a492aea37
|
@ -1,7 +1 @@
|
|||
This was generated from jqueryui.com.
|
||||
|
||||
It includes UI Core, Autocomplete and the Datepicker.
|
||||
|
||||
===========================
|
||||
|
||||
When adding something, don't forget the .css file, and do add it to settings.py!
|
||||
|
|
|
@ -0,0 +1,162 @@
|
|||
/*!
|
||||
* jQuery UI Mouse 1.8.16
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Mouse
|
||||
*
|
||||
* Depends:
|
||||
* jquery.ui.widget.js
|
||||
*/
|
||||
(function( $, undefined ) {
|
||||
|
||||
var mouseHandled = false;
|
||||
$( document ).mouseup( function( e ) {
|
||||
mouseHandled = false;
|
||||
});
|
||||
|
||||
$.widget("ui.mouse", {
|
||||
options: {
|
||||
cancel: ':input,option',
|
||||
distance: 1,
|
||||
delay: 0
|
||||
},
|
||||
_mouseInit: function() {
|
||||
var self = this;
|
||||
|
||||
this.element
|
||||
.bind('mousedown.'+this.widgetName, function(event) {
|
||||
return self._mouseDown(event);
|
||||
})
|
||||
.bind('click.'+this.widgetName, function(event) {
|
||||
if (true === $.data(event.target, self.widgetName + '.preventClickEvent')) {
|
||||
$.removeData(event.target, self.widgetName + '.preventClickEvent');
|
||||
event.stopImmediatePropagation();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
this.started = false;
|
||||
},
|
||||
|
||||
// TODO: make sure destroying one instance of mouse doesn't mess with
|
||||
// other instances of mouse
|
||||
_mouseDestroy: function() {
|
||||
this.element.unbind('.'+this.widgetName);
|
||||
},
|
||||
|
||||
_mouseDown: function(event) {
|
||||
// don't let more than one widget handle mouseStart
|
||||
if( mouseHandled ) { return };
|
||||
|
||||
// we may have missed mouseup (out of window)
|
||||
(this._mouseStarted && this._mouseUp(event));
|
||||
|
||||
this._mouseDownEvent = event;
|
||||
|
||||
var self = this,
|
||||
btnIsLeft = (event.which == 1),
|
||||
// event.target.nodeName works around a bug in IE 8 with
|
||||
// disabled inputs (#7620)
|
||||
elIsCancel = (typeof this.options.cancel == "string" && event.target.nodeName ? $(event.target).closest(this.options.cancel).length : false);
|
||||
if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
this.mouseDelayMet = !this.options.delay;
|
||||
if (!this.mouseDelayMet) {
|
||||
this._mouseDelayTimer = setTimeout(function() {
|
||||
self.mouseDelayMet = true;
|
||||
}, this.options.delay);
|
||||
}
|
||||
|
||||
if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
|
||||
this._mouseStarted = (this._mouseStart(event) !== false);
|
||||
if (!this._mouseStarted) {
|
||||
event.preventDefault();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// Click event may never have fired (Gecko & Opera)
|
||||
if (true === $.data(event.target, this.widgetName + '.preventClickEvent')) {
|
||||
$.removeData(event.target, this.widgetName + '.preventClickEvent');
|
||||
}
|
||||
|
||||
// these delegates are required to keep context
|
||||
this._mouseMoveDelegate = function(event) {
|
||||
return self._mouseMove(event);
|
||||
};
|
||||
this._mouseUpDelegate = function(event) {
|
||||
return self._mouseUp(event);
|
||||
};
|
||||
$(document)
|
||||
.bind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
|
||||
.bind('mouseup.'+this.widgetName, this._mouseUpDelegate);
|
||||
|
||||
event.preventDefault();
|
||||
|
||||
mouseHandled = true;
|
||||
return true;
|
||||
},
|
||||
|
||||
_mouseMove: function(event) {
|
||||
// IE mouseup check - mouseup happened when mouse was out of window
|
||||
if ($.browser.msie && !(document.documentMode >= 9) && !event.button) {
|
||||
return this._mouseUp(event);
|
||||
}
|
||||
|
||||
if (this._mouseStarted) {
|
||||
this._mouseDrag(event);
|
||||
return event.preventDefault();
|
||||
}
|
||||
|
||||
if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
|
||||
this._mouseStarted =
|
||||
(this._mouseStart(this._mouseDownEvent, event) !== false);
|
||||
(this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event));
|
||||
}
|
||||
|
||||
return !this._mouseStarted;
|
||||
},
|
||||
|
||||
_mouseUp: function(event) {
|
||||
$(document)
|
||||
.unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
|
||||
.unbind('mouseup.'+this.widgetName, this._mouseUpDelegate);
|
||||
|
||||
if (this._mouseStarted) {
|
||||
this._mouseStarted = false;
|
||||
|
||||
if (event.target == this._mouseDownEvent.target) {
|
||||
$.data(event.target, this.widgetName + '.preventClickEvent', true);
|
||||
}
|
||||
|
||||
this._mouseStop(event);
|
||||
}
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
_mouseDistanceMet: function(event) {
|
||||
return (Math.max(
|
||||
Math.abs(this._mouseDownEvent.pageX - event.pageX),
|
||||
Math.abs(this._mouseDownEvent.pageY - event.pageY)
|
||||
) >= this.options.distance
|
||||
);
|
||||
},
|
||||
|
||||
_mouseDelayMet: function(event) {
|
||||
return this.mouseDelayMet;
|
||||
},
|
||||
|
||||
// These are placeholder methods, to be overriden by extending plugin
|
||||
_mouseStart: function(event) {},
|
||||
_mouseDrag: function(event) {},
|
||||
_mouseStop: function(event) {},
|
||||
_mouseCapture: function(event) { return true; }
|
||||
});
|
||||
|
||||
})(jQuery);
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -522,8 +522,10 @@ MINIFY_BUNDLES = {
|
|||
'js/lib/jquery-ui/jquery.ui.core.js',
|
||||
'js/lib/jquery-ui/jquery.ui.position.js',
|
||||
'js/lib/jquery-ui/jquery.ui.widget.js',
|
||||
'js/lib/jquery-ui/jquery.ui.mouse.js',
|
||||
'js/lib/jquery-ui/jquery.ui.autocomplete.js',
|
||||
'js/lib/jquery-ui/jquery.ui.datepicker.js',
|
||||
'js/lib/jquery-ui/jquery.ui.sortable.js',
|
||||
|
||||
'js/zamboni/global.js',
|
||||
'js/amo2009/global.js',
|
||||
|
@ -583,8 +585,10 @@ MINIFY_BUNDLES = {
|
|||
'js/lib/jquery-ui/jquery.ui.core.js',
|
||||
'js/lib/jquery-ui/jquery.ui.position.js',
|
||||
'js/lib/jquery-ui/jquery.ui.widget.js',
|
||||
'js/lib/jquery-ui/jquery.ui.mouse.js',
|
||||
'js/lib/jquery-ui/jquery.ui.autocomplete.js',
|
||||
'js/lib/jquery-ui/jquery.ui.datepicker.js',
|
||||
'js/lib/jquery-ui/jquery.ui.sortable.js',
|
||||
|
||||
'js/zamboni/truncation.js',
|
||||
'js/zamboni/global.js',
|
||||
|
|
Загрузка…
Ссылка в новой задаче