|
@ -202,6 +202,8 @@ $.fn.modal = function(parameters) { |
|
|
module.verbose('Attaching events'); |
|
|
module.verbose('Attaching events'); |
|
|
$module |
|
|
$module |
|
|
.on('click' + eventNamespace, selector.close, module.event.close) |
|
|
.on('click' + eventNamespace, selector.close, module.event.close) |
|
|
|
|
|
.on('click' + eventNamespace, selector.approve, module.event.approve) |
|
|
|
|
|
.on('click' + eventNamespace, selector.deny, module.event.deny) |
|
|
; |
|
|
; |
|
|
$window |
|
|
$window |
|
|
.on('resize' + elementNamespace, module.event.resize) |
|
|
.on('resize' + elementNamespace, module.event.resize) |
|
@ -216,30 +218,22 @@ $.fn.modal = function(parameters) { |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
event: { |
|
|
event: { |
|
|
close: function() { |
|
|
|
|
|
var |
|
|
|
|
|
$element = $(this) |
|
|
|
|
|
; |
|
|
|
|
|
module.verbose('Closing element activated'); |
|
|
|
|
|
if( $element.is(selector.approve) ) { |
|
|
|
|
|
if(settings.onApprove.call(element, $element) !== false) { |
|
|
|
|
|
module.hide(); |
|
|
|
|
|
} |
|
|
|
|
|
else { |
|
|
|
|
|
module.verbose('Approve callback returned false cancelling hide'); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
else if( $element.is(selector.deny) ) { |
|
|
|
|
|
if(settings.onDeny.call(element, $element) !== false) { |
|
|
|
|
|
module.hide(); |
|
|
|
|
|
} |
|
|
|
|
|
else { |
|
|
|
|
|
module.verbose('Deny callback returned false cancelling hide'); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
approve: function() { |
|
|
|
|
|
if(settings.onApprove.call(element, $(this)) === false) { |
|
|
|
|
|
module.verbose('Approve callback returned false cancelling hide'); |
|
|
|
|
|
return; |
|
|
} |
|
|
} |
|
|
else { |
|
|
|
|
|
module.hide(); |
|
|
|
|
|
|
|
|
module.hide(); |
|
|
|
|
|
}, |
|
|
|
|
|
deny: function() { |
|
|
|
|
|
if(settings.onDeny.call(element, $(this)) === false) { |
|
|
|
|
|
module.verbose('Deny callback returned false cancelling hide'); |
|
|
|
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
module.hide(); |
|
|
|
|
|
}, |
|
|
|
|
|
close: function() { |
|
|
|
|
|
module.hide(); |
|
|
}, |
|
|
}, |
|
|
click: function(event) { |
|
|
click: function(event) { |
|
|
var |
|
|
var |
|
@ -884,7 +878,7 @@ $.fn.modal.settings = { |
|
|
onDeny : function(){ return true; }, |
|
|
onDeny : function(){ return true; }, |
|
|
|
|
|
|
|
|
selector : { |
|
|
selector : { |
|
|
close : '.close, .actions .button', |
|
|
|
|
|
|
|
|
close : '.close', |
|
|
approve : '.actions .positive, .actions .approve, .actions .ok', |
|
|
approve : '.actions .positive, .actions .approve, .actions .ok', |
|
|
deny : '.actions .negative, .actions .deny, .actions .cancel', |
|
|
deny : '.actions .negative, .actions .deny, .actions .cancel', |
|
|
modal : '.ui.modal' |
|
|
modal : '.ui.modal' |
|
|