[Pkg-owncloud-commits] [owncloud] 01/22: Trigger events when app-settings visibility changes
David Prévot
taffit at moszumanska.debian.org
Fri Aug 29 14:48:56 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository owncloud.
commit b94c88266bdab9a64633f7fa00734ec5c444f1c5
Author: Vincent Petry <pvince81 at owncloud.com>
Date: Mon Aug 11 16:29:15 2014 +0200
Trigger events when app-settings visibility changes
---
core/js/apps.js | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)
diff --git a/core/js/apps.js b/core/js/apps.js
index 5f221bb..d874f85 100644
--- a/core/js/apps.js
+++ b/core/js/apps.js
@@ -43,15 +43,26 @@
var areaSelector = $(button).data('apps-slide-toggle');
var area = $(areaSelector);
+ function hideArea() {
+ area.slideUp(function() {
+ area.trigger(new $.Event('hide'));
+ });
+ }
+ function showArea() {
+ area.slideDown(function() {
+ area.trigger(new $.Event('show'));
+ });
+ }
+
// do nothing if the area is animated
if (!area.is(':animated')) {
// button toggles the area
if (button === event.target) {
if (area.is(':visible')) {
- area.slideUp();
+ hideArea();
} else {
- area.slideDown();
+ showArea();
}
// all other areas that have not been clicked but are open
@@ -59,7 +70,7 @@
} else {
var closest = $(event.target).closest(areaSelector);
if (area.is(':visible') && closest[0] !== area[0]) {
- area.slideUp();
+ hideArea();
}
}
}
@@ -73,4 +84,4 @@
registerAppsSlideToggle();
});
-}(document, jQuery, OC));
\ No newline at end of file
+}(document, jQuery, OC));
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list