mirror of
https://github.com/FoggedLens/iD.git
synced 2026-04-29 07:06:04 +02:00
Follow ui pattern
This commit is contained in:
+2
-1
@@ -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
@@ -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();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user