aboutsummaryrefslogtreecommitdiffstats
path: root/js/main.js
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-01-07 13:40:58 -0800
committerfriendica <info@friendica.com>2013-01-07 13:40:58 -0800
commitf04ce3b093c03fc343fce5b93e6ec6c7fd1ab214 (patch)
treef26e330f8dbeba32786e29d9634c6cc17f0c28a8 /js/main.js
parent0001cc6fd38aaefa9bcabd1458b05ece855f3c67 (diff)
downloadvolse-hubzilla-f04ce3b093c03fc343fce5b93e6ec6c7fd1ab214.tar.gz
volse-hubzilla-f04ce3b093c03fc343fce5b93e6ec6c7fd1ab214.tar.bz2
volse-hubzilla-f04ce3b093c03fc343fce5b93e6ec6c7fd1ab214.zip
more work on notification system, fix a couple of minor issues from smarty conversion
Diffstat (limited to 'js/main.js')
-rw-r--r--js/main.js23
1 files changed, 19 insertions, 4 deletions
diff --git a/js/main.js b/js/main.js
index 356efcf79..18cf79ce8 100644
--- a/js/main.js
+++ b/js/main.js
@@ -163,14 +163,29 @@
last_popup_button = null;
}
}
+
+ /* Turn elements with one of our special rel tags into popup menus */
$('a[rel^=#]').click(function(e){
+ manage_popup_menu(this,e);
+ return false;
+ });
+
+ $('span[rel^=#]').click(function(e){
+ manage_popup_menu(this,e);
+ return false;
+ });
+
+
+ function manage_popup_menu(w,e) {
close_last_popup_menu();
- menu = $( $(this).attr('rel') );
+ menu = $( $(w).attr('rel') );
e.preventDefault();
e.stopPropagation();
if (menu.attr('popup')=="false") return false;
- $(this).parent().toggleClass("selected");
+ $(w).parent().toggleClass("selected");
+ /* notification menus are loaded dynamically
+ * - here we find a rel tag to figure out what type of notification to load */
var loader_source = $(menu).attr('rel');
if(loader_source.length) {
notify_popup_loader(loader_source);
@@ -181,10 +196,10 @@
last_popup_button = null;
} else {
last_popup_menu = menu;
- last_popup_button = $(this).parent();
+ last_popup_button = $(w).parent();
}
return false;
- });
+ }
$('html').click(function() {
close_last_popup_menu();