Follow ui pattern

This commit is contained in:
John Firebaugh
2013-02-12 20:08:36 -08:00
parent 0578d645bc
commit 02ed91096a
2 changed files with 31 additions and 30 deletions
+2 -1
View File
@@ -154,7 +154,8 @@ iD.ui = function(context) {
}
if (history.lock() && history.restorableChanges()) {
iD.ui.restore(context.container(), history);
context.container()
.call(iD.ui.Restore(context))
}
};
+29 -29
View File
@@ -1,37 +1,37 @@
iD.ui.restore = function(selection, history) {
var modal = iD.ui.modal(selection);
iD.ui.Restore = function(context) {
return function(selection) {
var modal = iD.ui.modal(selection);
modal.select('.modal')
.attr('class', 'modal-splash modal');
modal.select('.modal')
.attr('class', 'modal-splash modal');
var introModal = modal.select('.content');
var introModal = modal.select('.content');
introModal.append('div')
.attr('class', 'modal-section fillL')
.append('h3')
.text(t('restore.description'));
introModal.append('div')
.attr('class', 'modal-section fillL')
.append('h3')
.text(t('restore.description'));
var buttonWrap = introModal.append('div')
.attr('class', 'modal-section fillD cf col12');
var buttonWrap = introModal.append('div')
.attr('class', 'modal-section fillD cf col12');
var buttons = buttonWrap
.append('div')
.attr('class', 'button-wrap joined col6');
var buttons = buttonWrap
.append('div')
.attr('class', 'button-wrap joined col6');
buttons.append('button')
.attr('class', 'save action button col6')
.text(t('restore.restore'))
.on('click', function() {
history.load();
modal.remove();
});
buttons.append('button')
.attr('class', 'save action button col6')
.text(t('restore.restore'))
.on('click', function() {
context.history().load();
modal.remove();
});
buttons.append('button')
.attr('class', 'cancel button col6')
.text(t('restore.reset'))
.on('click', function() {
modal.remove();
});
return modal;
buttons.append('button')
.attr('class', 'cancel button col6')
.text(t('restore.reset'))
.on('click', function() {
modal.remove();
});
}
};