From bfed8b3a7db276386ee4924e1c140633ed3ce494 Mon Sep 17 00:00:00 2001 From: jlukic Date: Tue, 31 Mar 2015 15:20:40 -0400 Subject: [PATCH] #2042 add delegated events to video, form. remove debug dimmer --- src/definitions/behaviors/form.js | 23 +++++++++-------------- src/definitions/modules/dimmer.js | 4 ++-- src/definitions/modules/video.js | 14 +++----------- 3 files changed, 14 insertions(+), 27 deletions(-) diff --git a/src/definitions/behaviors/form.js b/src/definitions/behaviors/form.js index 7cef56c1b..7fa4df42c 100644 --- a/src/definitions/behaviors/form.js +++ b/src/definitions/behaviors/form.js @@ -127,23 +127,18 @@ $.fn.form = function(parameters) { bindEvents: function() { module.verbose('Attaching form events'); - if(settings.keyboardShortcuts) { - $field - .on('keydown' + eventNamespace, module.event.field.keydown) - ; - } $module .on('submit' + eventNamespace, module.validate.form) + .on('blur' + eventNamespace, selector.field, module.event.field.blur) + .on('click' + eventNamespace, selector.submit, module.submit) + .on('click' + eventNamespace, selector.reset, module.reset) + .on('click' + eventNamespace, selector.clear, module.clear) ; - $field - .on('blur' + eventNamespace, module.event.field.blur) - ; - - // attach events to common elements - module.attachEvents($submit, 'submit'); - module.attachEvents($reset, 'reset'); - module.attachEvents($clear, 'clear'); - + if(settings.keyboardShortcuts) { + $module + .on('keydown' + eventNamespace, selector.field, module.event.field.keydown) + ; + } $field .each(function() { var diff --git a/src/definitions/modules/dimmer.js b/src/definitions/modules/dimmer.js index ec6282e8a..b1e08d24a 100644 --- a/src/definitions/modules/dimmer.js +++ b/src/definitions/modules/dimmer.js @@ -599,8 +599,8 @@ $.fn.dimmer.settings = { name : 'Dimmer', namespace : 'dimmer', - debug : true, - verbose : true, + debug : false, + verbose : false, performance : true, // name to distinguish between multiple dimmers in context diff --git a/src/definitions/modules/video.js b/src/definitions/modules/video.js index 43c1fc1fb..91bce4d2a 100644 --- a/src/definitions/modules/video.js +++ b/src/definitions/modules/video.js @@ -69,11 +69,9 @@ $.fn.video = function(parameters) { initialize: function() { module.debug('Initializing video'); module.create(); - $placeholder - .on('click' + eventNamespace, module.play) - ; - $playButton - .on('click' + eventNamespace, module.play) + $module + .on('click' + eventNamespace, selector.placeholder, module.play) + .on('click' + eventNamespace, selector.playButton, module.play) ; module.instantiate(); }, @@ -106,12 +104,6 @@ $.fn.video = function(parameters) { .removeData(moduleNamespace) .off(eventNamespace) ; - $placeholder - .off(eventNamespace) - ; - $playButton - .off(eventNamespace) - ; }, refresh: function() {