aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/adm/style/ajax.js
diff options
context:
space:
mode:
authorIgor Wiedler <igor@wiedler.ch>2012-02-08 18:42:21 +0100
committerIgor Wiedler <igor@wiedler.ch>2012-03-31 02:09:23 +0200
commit30888ff2a009fe5a001046484d5df4b6e2c67ac8 (patch)
treeed139226a6ab58c4a5f0725662cb46e9d4ad2feb /phpBB/adm/style/ajax.js
parent265907b1150303ca141be0f09de4093cbfb6d9f5 (diff)
downloadforums-30888ff2a009fe5a001046484d5df4b6e2c67ac8.tar
forums-30888ff2a009fe5a001046484d5df4b6e2c67ac8.tar.gz
forums-30888ff2a009fe5a001046484d5df4b6e2c67ac8.tar.bz2
forums-30888ff2a009fe5a001046484d5df4b6e2c67ac8.tar.xz
forums-30888ff2a009fe5a001046484d5df4b6e2c67ac8.zip
[feature/ajax] Use attr('data-foo') instead of data('foo')
data() is slower and does additional unwanted things like caching and type conversion. Just reading the value is safer. PHPBB3-10270
Diffstat (limited to 'phpBB/adm/style/ajax.js')
-rw-r--r--phpBB/adm/style/ajax.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/phpBB/adm/style/ajax.js b/phpBB/adm/style/ajax.js
index 902e072dda..50477eef90 100644
--- a/phpBB/adm/style/ajax.js
+++ b/phpBB/adm/style/ajax.js
@@ -12,7 +12,7 @@ phpbb.add_ajax_callback('forum_down', function() {
var tr = el.parents('tr');
if (tr.is(':first-child'))
{
- el.parents('span').siblings('.up').html('<a href="' + tr.data('up') + '"><img src="./images/icon_up.gif" alt="Move up" title="Move up" /></a>');
+ el.parents('span').siblings('.up').html('<a href="' + tr.attr('data-up') + '"><img src="./images/icon_up.gif" alt="Move up" title="Move up" /></a>');
tr.next().find('.up').html('<img src="./images/icon_up_disabled.gif" alt="Move up" title="Move up" />');
phpbb.ajaxify({selector: el.parents('span').siblings('.up').children('a')}, false, 'forum_up');
}
@@ -20,7 +20,7 @@ phpbb.add_ajax_callback('forum_down', function() {
if (tr.is(':last-child'))
{
el.html('<img src="./images/icon_down_disabled.gif" alt="Move down" title="Move down" />');
- tr.prev().find('.down').html('<a href="' + tr.data('down') + '"><img src="./images/icon_down.gif" alt="Move down" title="Move down" /></a>');
+ tr.prev().find('.down').html('<a href="' + tr.attr('data-down') + '"><img src="./images/icon_down.gif" alt="Move down" title="Move down" /></a>');
phpbb.ajaxify({selector: tr.prev().find('.down').children('a')}, false, 'forum_down');
}
}).add_ajax_callback('forum_up', function() {
@@ -28,7 +28,7 @@ phpbb.add_ajax_callback('forum_down', function() {
var tr = el.parents('tr');
if (tr.is(':last-child'))
{
- el.parents('span').siblings('.down').html('<a href="' + tr.data('down') + '"><img src="./images/icon_down.gif" alt="Move down" title="Move down" /></a>');
+ el.parents('span').siblings('.down').html('<a href="' + tr.attr('data-down') + '"><img src="./images/icon_down.gif" alt="Move down" title="Move down" /></a>');
tr.prev().find('.down').html('<img src="./images/icon_down_disabled.gif" alt="Move down" title="Move down" />');
phpbb.ajaxify({selector: el.parents('span').siblings('.down').children('a')}, false, 'forum_down');
}
@@ -36,7 +36,7 @@ phpbb.add_ajax_callback('forum_down', function() {
if (tr.is(':first-child'))
{
el.html('<img src="./images/icon_up_disabled.gif" alt="Move up" title="Move up" />');
- tr.next().find('.up').html('<a href="' + tr.data('up') + '"><img src="./images/icon_up.gif" alt="Move up" title="Move up" /></a>');
+ tr.next().find('.up').html('<a href="' + tr.attr('data-up') + '"><img src="./images/icon_up.gif" alt="Move up" title="Move up" /></a>');
phpbb.ajaxify({selector: tr.next().find('.up').children('a')}, false, 'forum_up');
}
});
@@ -72,11 +72,11 @@ phpbb.add_ajax_callback('row_delete', function() {
$('[data-ajax]').each(function() {
- var $this = $(this), ajax = $this.data('ajax');
+ var $this = $(this), ajax = $this.attr('data-ajax');
if (ajax !== 'false')
{
var fn = (ajax !== 'true') ? ajax : null;
- phpbb.ajaxify({selector: this}, $this.data('refresh') !== undefined, fn);
+ phpbb.ajaxify({selector: this}, $this.attr('data-refresh') !== undefined, fn);
}
});