]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Fixed plugin 'double dip' in foundation.reflow.fn 7374/head
authorPhil Musser <philipm@criticalmass.com>
Thu, 3 Dec 2015 17:51:29 +0000 (10:51 -0700)
committerPhil Musser <philipm@criticalmass.com>
Thu, 3 Dec 2015 17:51:29 +0000 (10:51 -0700)
Checking for “double dip” on plugins should use the jQuery ‘data’
instead of ‘attr’ since ‘zf-plugin’ is set as a jQuery data key when
the instance of the plugin on the element is created.

js/foundation.core.js

index 6a8d6ce1e6b8fe068a458dea51208c489bcc8b2f..0141272c70aad7b5b6d02b09344846cbf84bfa90 100644 (file)
@@ -168,7 +168,7 @@ var Foundation = {
         var $el = $(this),
             opts = {};
         // Don't double-dip on plugins
-        if ($el.attr('zf-plugin')) {
+        if ($el.data('zf-plugin')) {
           console.warn("Tried to initialize "+name+" on an element that already has a Foundation plugin.");
           return;
         }