app/assets/javascripts/semantic-ui/modal.js in semantic-ui-sass-1.7.0.0 vs app/assets/javascripts/semantic-ui/modal.js in semantic-ui-sass-1.7.3.0

- old
+ new

@@ -170,11 +170,11 @@ ; event = $.isFunction(module[event]) ? module[event] : module.toggle ; - if($toggle.size() > 0) { + if($toggle.length > 0) { module.debug('Attaching modal events to element', selector, event); $toggle .off(eventNamespace) .on('click' + eventNamespace, event) ; @@ -203,19 +203,19 @@ event: { close: function() { module.verbose('Closing element pressed'); if( $(this).is(selector.approve) ) { - if($.proxy(settings.onApprove, element)() !== false) { + if(settings.onApprove.call(element) !== false) { module.hide(); } else { module.verbose('Approve callback returned false cancelling hide'); } } else if( $(this).is(selector.deny) ) { - if($.proxy(settings.onDeny, element)() !== false) { + if(settings.onDeny.call(element) !== false) { module.hide(); } else { module.verbose('Deny callback returned false cancelling hide'); } @@ -223,11 +223,11 @@ else { module.hide(); } }, click: function(event) { - if( $(event.target).closest($module).size() === 0 ) { + if( $(event.target).closest($module).length === 0 ) { module.debug('Dimmer clicked, hiding all modals'); if( module.is.active() ) { module.remove.clickaway(); if(settings.allowMultiple) { module.hide(); @@ -304,27 +304,27 @@ module.set.position(); module.set.screenHeight(); module.set.type(); module.set.clickaway(); - if( !settings.allowMultiple && $otherModals.filter(':visible').size() > 0) { + if( !settings.allowMultiple && $otherModals.filter(':visible').length > 0) { module.debug('Other modals visible, queueing show animation'); module.hideOthers(module.showModal); } else { - $.proxy(settings.onShow, element)(); + settings.onShow.call(element); if(settings.transition && $.fn.transition !== undefined && $module.transition('is supported')) { module.debug('Showing modal with css animations'); $module .transition({ debug : settings.debug, animation : settings.transition + ' in', queue : settings.queue, duration : settings.duration, useFailSafe : true, onComplete : function() { - $.proxy(settings.onVisible, element)(); + settings.onVisible.apply(element); module.add.keyboardShortcuts(); module.save.focus(); module.set.active(); module.set.autofocus(); callback(); @@ -334,11 +334,11 @@ } else { module.debug('Showing modal with javascript'); $module .fadeIn(settings.duration, settings.easing, function() { - $.proxy(settings.onVisible, element)(); + settings.onVisible.apply(element); module.add.keyboardShortcuts(); module.save.focus(); module.set.active(); callback(); }) @@ -355,11 +355,11 @@ callback = $.isFunction(callback) ? callback : function(){} ; module.debug('Hiding modal'); - $.proxy(settings.onHide, element)(); + settings.onHide.call(element); if( module.is.animating() || module.is.active() ) { if(settings.transition && $.fn.transition !== undefined && $module.transition('is supported')) { module.remove.active(); $module @@ -374,11 +374,11 @@ module.hideDimmer(); } module.remove.keyboardShortcuts(); }, onComplete : function() { - $.proxy(settings.onHidden, element)(); + settings.onHidden.call(element); module.restore.focus(); callback(); } }) ; @@ -389,11 +389,11 @@ module.hideDimmer(); } module.remove.keyboardShortcuts(); $module .fadeOut(settings.duration, settings.easing, function() { - $.proxy(settings.onHidden, element)(); + settings.onHidden.call(element); module.restore.focus(); callback(); }) ; } @@ -453,11 +453,11 @@ ; } }, othersActive: function() { - return ($otherModals.filter('.' + className.active).size() > 0); + return ($otherModals.filter('.' + className.active).length > 0); }, add: { keyboardShortcuts: function() { module.verbose('Adding keyboard shortcuts'); @@ -473,11 +473,11 @@ } }, restore: { focus: function() { - if($focusedElement && $focusedElement.size() > 0) { + if($focusedElement && $focusedElement.length > 0) { $focusedElement.focus(); } } }, @@ -557,10 +557,10 @@ autofocus: function() { if(settings.autofocus) { var $inputs = $module.find(':input:visible'), $autofocus = $inputs.filter('[autofocus]'), - $input = ($autofocus.size() > 0) + $input = ($autofocus.length > 0) ? $autofocus : $inputs ; $input.first().focus(); }