-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #229 from m1x0n/replace-modals
replace-modals: Replaced alerts by custom. Disabled a confirmation of…
- Loading branch information
Showing
13 changed files
with
106 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
define([ | ||
'app', | ||
'marionette', | ||
'backbone', | ||
'../views/popup/alert', | ||
], function (App, Marionette, Backbone, AlertView) { | ||
window.alert = function(message, title) { | ||
var title = title || i18n.t("ui.alert-title"); | ||
|
||
var alertView = new AlertView({ | ||
message: message | ||
}); | ||
|
||
App.trigger('popup:show', { | ||
header: { | ||
title: title | ||
}, | ||
class: 'alert-form', | ||
contentView: alertView | ||
}); | ||
|
||
App.listenTo( | ||
alertView, | ||
'form:submit', | ||
function () { | ||
App.trigger('popup:close'); | ||
} | ||
); | ||
}; | ||
}); |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
define([ | ||
'app', | ||
'marionette', | ||
'backbone', | ||
'tpl!views/templates/popup/alert.tpl' | ||
], function ( | ||
App, | ||
Marionette, | ||
Backbone, | ||
AlertTpl | ||
) { | ||
App.Folder.Views.AlertView = Marionette.ItemView.extend({ | ||
tagName: 'div', | ||
id: 'alert', | ||
template: AlertTpl, | ||
|
||
events: { | ||
'submit form': 'submit' | ||
}, | ||
|
||
submit: function (event) { | ||
event.preventDefault(); | ||
this.trigger('form:submit'); | ||
}, | ||
|
||
render: function () { | ||
this.$el.html(this.template({ | ||
message: this.message, | ||
_t: i18n.t | ||
})); | ||
}, | ||
|
||
initialize: function (options) { | ||
this.message = options.message; | ||
} | ||
}); | ||
|
||
return App.Folder.Views.AlertView; | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<form action=""> | ||
<div class="form-horizontal"> | ||
<div class="form-group"> | ||
<div class="col-md-12 col-lg-12 col-sm-12 col-xs-12"> | ||
<p> | ||
<%= message %> | ||
</p> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="form-group controls"> | ||
<button type="submit" class="btn btn-sm btn-info">Ok</button> | ||
</div> | ||
</form> |