diff options
author | Igor Wiedler <igor@wiedler.ch> | 2012-02-08 18:42:21 +0100 |
---|---|---|
committer | Igor Wiedler <igor@wiedler.ch> | 2012-03-31 02:09:23 +0200 |
commit | 30888ff2a009fe5a001046484d5df4b6e2c67ac8 (patch) | |
tree | ed139226a6ab58c4a5f0725662cb46e9d4ad2feb /phpBB/assets | |
parent | 265907b1150303ca141be0f09de4093cbfb6d9f5 (diff) | |
download | forums-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/assets')
-rw-r--r-- | phpBB/assets/javascript/core.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/phpBB/assets/javascript/core.js b/phpBB/assets/javascript/core.js index 7b6bc4304a..4e0ed11a8e 100644 --- a/phpBB/assets/javascript/core.js +++ b/phpBB/assets/javascript/core.js @@ -31,7 +31,7 @@ phpbb.loading_alert = function() { setTimeout(function() { if (loading_alert.is(':visible')) { - phpbb.alert($('#phpbb_alert').data('l-err'), $('#phpbb_alert').data('l-timeout-processing-req')); + phpbb.alert($('#phpbb_alert').attr('data-l-err'), $('#phpbb_alert').attr('data-l-timeout-processing-req')); } }, 5000); }); @@ -125,7 +125,7 @@ phpbb.confirm = function(msg, callback, fadedark) { e.stopPropagation(); return true; }); - + var click_handler = function() { var res = this.className === 'button1'; var fade = (typeof fadedark !== 'undefined' && !fadedark && res) ? div : dark; @@ -236,7 +236,7 @@ phpbb.ajaxify = function(options, refresh, callback) { elements.click(function() { var action, data, path, that = this, $this = $(this); - if ($this.data('ajax') == false) + if ($this.attr('data-ajax') == false) { return true; } @@ -385,8 +385,8 @@ phpbb.add_ajax_callback = function(id, callback) */ phpbb.add_ajax_callback('alt_text', function(el) { el = $(el); - var alt_text = el.data('alt-text'); - el.data('alt-text', el.text()); + var alt_text = el.attr('data-alt-text'); + el.attr('data-alt-text', el.text()); el.text(el[0].title = alt_text); }); |