]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Restoring namespaced events 5947/head
authorjeffclemens <jeffclemens@users.noreply.github.com>
Fri, 17 Oct 2014 15:12:09 +0000 (11:12 -0400)
committerjeffclemens <jeffclemens@users.noreply.github.com>
Fri, 17 Oct 2014 15:12:09 +0000 (11:12 -0400)
Namespaced events were added by @thedeerchild  here: https://github.com/zurb/foundation/commit/179f3d1fc2a0bc785438ec1a74faf5ef86855f81
Then they were removed here (probably by mistake): https://github.com/zurb/foundation/commit/179f3d1fc2a0bc785438ec1a74faf5ef86855f81
That commit was partially undone here: https://github.com/zurb/foundation/commit/4e164cc29cedf8e9bd5c312483a90f454c69dc72
But the namespaced events weren't restored.  This commit re-adds them, as specified in that first commit.
Without namespaced events, Abide doesn't act like the Events section of its documentation says it should here: http://foundation.zurb.com/docs/components/abide.html#events

js/foundation/foundation.abide.js

index 59f0d069e5ed77e64e08c6a86883b811f977f1e8..9f0c26ba6167d2183c0b82991a54873033ecfaf7 100644 (file)
       for (var i=0; i < validation_count; i++) {
         if (!validations[i] && (submit_event || is_ajax)) {
           if (this.settings.focus_on_invalid) els[i].focus();
-          form.trigger('invalid');
+          form.trigger('invalid').trigger('invalid.fndtn.abide');
           this.S(els[i]).closest('form').attr(this.invalid_attr, '');
           return false;
         }
       }
 
       if (submit_event || is_ajax) {
-        form.trigger('valid');
+        form.trigger('valid').trigger('valid.fndtn.abide');
       }
 
       form.removeAttr(this.invalid_attr);