From a09e12721fbab8f1f716495a04957f52595fc272 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 17 Feb 2015 20:01:56 +0100 Subject: Fix lib in .gitignore --- .../Default/lib/MooTools/MooDialog/MooDialog.Fx.js | 47 ++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 pyload/webui/themes/Default/lib/MooTools/MooDialog/MooDialog.Fx.js (limited to 'pyload/webui/themes/Default/lib/MooTools/MooDialog/MooDialog.Fx.js') diff --git a/pyload/webui/themes/Default/lib/MooTools/MooDialog/MooDialog.Fx.js b/pyload/webui/themes/Default/lib/MooTools/MooDialog/MooDialog.Fx.js new file mode 100644 index 000000000..353d947f5 --- /dev/null +++ b/pyload/webui/themes/Default/lib/MooTools/MooDialog/MooDialog.Fx.js @@ -0,0 +1,47 @@ +/* +--- +name: MooDialog.Fx +description: Overwrite the default events so the Dialogs are using Fx on open and close +authors: Arian Stolwijk +license: MIT-style license +requires: [Core/Fx.Tween, Overlay] +provides: MooDialog.Fx +... +*/ + + +MooDialog.implement('options', { + + duration: 400, + closeOnOverlayClick: true, + + onInitialize: function(wrapper){ + this.fx = new Fx.Tween(wrapper, { + property: 'opacity', + duration: this.options.duration + }).set(0); + this.overlay = new Overlay(this.options.inject, { + duration: this.options.duration + }); + if (this.options.closeOnOverlayClick) this.overlay.addEvent('click', this.close.bind(this)); + + this.addEvent('hide', function(){ + if (this.options.destroyOnHide) this.overlay.overlay.destroy(); + }.bind(this)); + }, + + onBeforeOpen: function(wrapper){ + this.overlay.open(); + this.fx.start(1).chain(function(){ + this.fireEvent('show'); + }.bind(this)); + }, + + onBeforeClose: function(wrapper){ + this.overlay.close(); + this.fx.start(0).chain(function(){ + this.fireEvent('hide'); + }.bind(this)); + } + +}); -- cgit v1.2.3