Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/rikulo/bootjack
Browse files Browse the repository at this point in the history
  • Loading branch information
tomyeh committed Apr 27, 2016
2 parents 59a4ac7 + ef31389 commit 48b6545
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions lib/src/modal.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ class Modal extends Base {
this.backdrop = backdrop,
this.keyboard = keyboard,
super(element, _NAME) {
$element.on('click.dismiss.modal', (QueryEvent e) => hide(), selector: '[data-dismiss="modal"]');
if (remote != null) {
//this.$element.find('.modal-body').load(this.options.remote)
}
}

/** Retrieve the wired Modal object from an element. If there is no wired
Expand Down Expand Up @@ -60,7 +56,7 @@ class Modal extends Base {
_shown = true;

if (keyboard) {
$element.on('keyup.dismiss.modal', (QueryEvent e) {
$document().on('keyup.dismiss.modal', (QueryEvent e) {
if ((e.originalEvent as KeyboardEvent).keyCode == 27)
hide();
});
Expand Down Expand Up @@ -93,7 +89,14 @@ class Modal extends Base {
$element.trigger('shown.bs.modal');

}


$element.on('click.modal.backdrop', (QueryEvent e){
if($element[0] == e.target && backdrop != 'static'){
hide();
}
});

$element.on('click.dismiss.modal', (QueryEvent e) => hide(), selector: '[data-dismiss="modal"]');
});

}
Expand All @@ -110,6 +113,9 @@ class Modal extends Base {
_shown = false;

$element.off('keyup.dismiss.modal');
$element.off('click.modal.backdrop');
$element.off('click.dismiss.modal');


$document().off('focusin.modal');

Expand Down Expand Up @@ -178,9 +184,7 @@ class Modal extends Base {
_backdropElem.classes.add('fade');
document.body.append(_backdropElem);

final $_backdropElem =
$(_backdropElem)..on('click', backdrop == 'static' ?
(QueryEvent e) => element.focus() : (QueryEvent e) => hide());
final $_backdropElem = $(_backdropElem);

if (animate) $_backdropElem.reflow();

Expand Down

0 comments on commit 48b6545

Please sign in to comment.