From b52a533a0f1b145f675a920a18b367d3767731d7 Mon Sep 17 00:00:00 2001 From: shadlaws Date: Sat, 23 Feb 2013 21:49:29 +0100 Subject: #2014 - Clean up gallery.ajax.js. - prepend "data-" in front of non-standard attr to be more standards compliant. - fix formatting. --- lib/gallery.ajax.js | 4 ++-- modules/gallery/views/menu_ajax_link.html.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/gallery.ajax.js b/lib/gallery.ajax.js index f27f3969..08f1fede 100644 --- a/lib/gallery.ajax.js +++ b/lib/gallery.ajax.js @@ -2,10 +2,10 @@ $.widget("ui.gallery_ajax", { _init: function() { this.element.click(function(event) { - eval("var ajax_handler = " + $(event.currentTarget).attr("ajax_handler")); + eval("var ajax_handler = " + $(event.currentTarget).attr("data-ajax-handler")); $.get($(event.currentTarget).attr("href"), function(data) { ajax_handler(data); - }); + }); event.preventDefault(); return false; }); diff --git a/modules/gallery/views/menu_ajax_link.html.php b/modules/gallery/views/menu_ajax_link.html.php index 06cd6f92..66df84c9 100644 --- a/modules/gallery/views/menu_ajax_link.html.php +++ b/modules/gallery/views/menu_ajax_link.html.php @@ -4,7 +4,7 @@ class="g-ajax-link css_class ?>" href="url ?>" title="label->for_html_attr() ?>" - ajax_handler="ajax_handler ?>"> + data-ajax-handler="ajax_handler ?>"> label->for_html() ?> -- cgit v1.2.3