animacion difusion eliminada
This commit is contained in:
+67
-1
@@ -17,7 +17,73 @@ GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
*/
|
||||
|
||||
// Disable jQuery fade animations to make UI snappier
|
||||
(function (win) {
|
||||
if (!win || !win.jQuery) {
|
||||
return;
|
||||
}
|
||||
var $ = win.jQuery;
|
||||
if ($.fn._noAnimationPatch) {
|
||||
return;
|
||||
}
|
||||
function getCallback(args) {
|
||||
for (var i = args.length - 1; i >= 0; i--) {
|
||||
if (typeof args[i] === 'function') {
|
||||
return args[i];
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
function immediate(action) {
|
||||
return function () {
|
||||
var callback = getCallback(arguments);
|
||||
return this.each(function () {
|
||||
var el = $(this);
|
||||
if (action === 'show') {
|
||||
el.show().css('opacity', 1);
|
||||
} else if (action === 'hide') {
|
||||
el.hide().css('opacity', 0);
|
||||
}
|
||||
if (callback) {
|
||||
callback.call(this);
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
$.fn.fadeIn = immediate('show');
|
||||
$.fn.fadeOut = immediate('hide');
|
||||
$.fn.fadeTo = function () {
|
||||
var callback = getCallback(arguments);
|
||||
var target = typeof arguments[1] === 'number' ? arguments[1] : 1;
|
||||
return this.each(function () {
|
||||
var el = $(this);
|
||||
el.css('opacity', target);
|
||||
if (target === 0) {
|
||||
el.hide();
|
||||
} else {
|
||||
el.show();
|
||||
}
|
||||
if (callback) {
|
||||
callback.call(this);
|
||||
}
|
||||
});
|
||||
};
|
||||
$.fn.fadeToggle = function () {
|
||||
var callback = getCallback(arguments);
|
||||
return this.each(function () {
|
||||
var el = $(this);
|
||||
var hidden = !el.is(':visible') || el.css('opacity') === '0';
|
||||
if (hidden) {
|
||||
el.fadeIn(callback);
|
||||
} else {
|
||||
el.fadeOut(callback);
|
||||
}
|
||||
});
|
||||
};
|
||||
$.fn._noAnimationPatch = true;
|
||||
})(window);
|
||||
|
||||
var globalSettings={
|
||||
version: {value: (typeof globalSettingsVersion!='undefined' && globalSettingsVersion!=null) ? globalSettingsVersion : 1, locked:false},
|
||||
|
||||
Reference in New Issue
Block a user