Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Make dialog methods take an option object instead of a boolean parameter

Issue #1065
  • Loading branch information...
commit 0a83f784c5e635abc6c77fbc9a97f1e690c58a2f 1 parent 38d0c32
@marijnh marijnh authored
Showing with 6 additions and 6 deletions.
  1. +2 −2 keymap/vim.js
  2. +4 −4 lib/util/dialog.js
View
4 keymap/vim.js
@@ -1769,7 +1769,7 @@
}
function dialog(cm, text, shortText, callback) {
if (cm.openDialog) {
- cm.openDialog(text, callback, true /** bottom */);
+ cm.openDialog(text, callback, {bottom: true});
}
else {
callback(prompt(shortText, ""));
@@ -1802,7 +1802,7 @@
if (cm.openConfirm) {
cm.openConfirm('<span style="color: red">' + text +
'</span> <button type="button">OK</button>', function() {},
- true /** bottom */);
+ {bottom: true});
} else {
alert(text);
}
View
8 lib/util/dialog.js
@@ -14,8 +14,8 @@
return dialog;
}
- CodeMirror.defineExtension("openDialog", function(template, callback, bottom) {
- var dialog = dialogDiv(this, template, bottom);
+ CodeMirror.defineExtension("openDialog", function(template, callback, options) {
+ var dialog = dialogDiv(this, template, options && options.bottom);
var closed = false, me = this;
function close() {
if (closed) return;
@@ -45,8 +45,8 @@
return close;
});
- CodeMirror.defineExtension("openConfirm", function(template, callbacks, bottom) {
- var dialog = dialogDiv(this, template, bottom);
+ CodeMirror.defineExtension("openConfirm", function(template, callbacks, options) {
+ var dialog = dialogDiv(this, template, options && options.bottom);
var buttons = dialog.getElementsByTagName("button");
var closed = false, me = this, blurring = 1;
function close() {
Please sign in to comment.
Something went wrong with that request. Please try again.