Merge pull request #2267 from ajaxorg/fix/various
Fix various small issues
This commit is contained in:
commit
7b037f35ba
5 changed files with 25 additions and 13 deletions
|
|
@ -117,12 +117,19 @@ module.exports = {
|
||||||
assert.equal(o.getOption("initialValue"), 8);
|
assert.equal(o.getOption("initialValue"), 8);
|
||||||
o.setOption("initialValue", 7);
|
o.setOption("initialValue", 7);
|
||||||
assert.equal(o.getOption("opt2"), 7);
|
assert.equal(o.getOption("opt2"), 7);
|
||||||
|
|
||||||
|
config.setDefaultValues("test_object", {
|
||||||
|
opt1: 1,
|
||||||
|
forwarded: 2
|
||||||
|
});
|
||||||
|
config.resetOptions(o);
|
||||||
|
assert.equal(o.getOption("opt1"), 1);
|
||||||
|
assert.equal(o.getOption("forwarded"), 2);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
if (typeof module !== "undefined" && module === require.main) {
|
if (typeof module !== "undefined" && module === require.main) {
|
||||||
require("asyncjs").test.testcase(module.exports).exec()
|
require("asyncjs").test.testcase(module.exports).exec();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -539,11 +539,14 @@ var Editor = function(renderer, session) {
|
||||||
var iterator = new TokenIterator(self.session, pos.row, pos.column);
|
var iterator = new TokenIterator(self.session, pos.row, pos.column);
|
||||||
var token = iterator.getCurrentToken();
|
var token = iterator.getCurrentToken();
|
||||||
|
|
||||||
if (!token || token.type.indexOf('tag-name') === -1) {
|
if (!token || !/\b(?:tag-open|tag-name)/.test(token.type)) {
|
||||||
session.removeMarker(session.$tagHighlight);
|
session.removeMarker(session.$tagHighlight);
|
||||||
session.$tagHighlight = null;
|
session.$tagHighlight = null;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (token.type.indexOf("tag-open") != -1)
|
||||||
|
token = iterator.stepForward();
|
||||||
|
|
||||||
var tag = token.value;
|
var tag = token.value;
|
||||||
var depth = 0;
|
var depth = 0;
|
||||||
|
|
|
||||||
|
|
@ -45,10 +45,10 @@ var TextInput = function(parentNode, host) {
|
||||||
if (useragent.isTouchPad)
|
if (useragent.isTouchPad)
|
||||||
text.setAttribute("x-palm-disable-auto-cap", true);
|
text.setAttribute("x-palm-disable-auto-cap", true);
|
||||||
|
|
||||||
text.wrap = "off";
|
text.setAttribute("wrap", "off");
|
||||||
text.autocorrect = "off";
|
text.setAttribute("autocorrect", "off");
|
||||||
text.autocapitalize = "off";
|
text.setAttribute("autocapitalize", "off");
|
||||||
text.spellcheck = false;
|
text.setAttribute("spellcheck", false);
|
||||||
|
|
||||||
text.style.opacity = "0";
|
text.style.opacity = "0";
|
||||||
if (useragent.isOldIE) text.style.top = "-100px";
|
if (useragent.isOldIE) text.style.top = "-100px";
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,6 @@
|
||||||
define(function(require, exports, module) {
|
define(function(require, exports, module) {
|
||||||
"no use strict";
|
"no use strict";
|
||||||
|
|
||||||
var lang = require("./lang");
|
|
||||||
var oop = require("./oop");
|
var oop = require("./oop");
|
||||||
var EventEmitter = require("./event_emitter").EventEmitter;
|
var EventEmitter = require("./event_emitter").EventEmitter;
|
||||||
|
|
||||||
|
|
@ -91,10 +90,10 @@ function reportError(msg, data) {
|
||||||
if (typeof console == "object" && console.error)
|
if (typeof console == "object" && console.error)
|
||||||
console.error(e);
|
console.error(e);
|
||||||
setTimeout(function() { throw e; });
|
setTimeout(function() { throw e; });
|
||||||
};
|
}
|
||||||
|
|
||||||
var AppConfig = function() {
|
var AppConfig = function() {
|
||||||
this.$defaultOptions = {};
|
this.$defaultOptions = {};
|
||||||
};
|
};
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
|
|
@ -145,7 +144,7 @@ var AppConfig = function() {
|
||||||
this.setDefaultValues = function(path, optionHash) {
|
this.setDefaultValues = function(path, optionHash) {
|
||||||
Object.keys(optionHash).forEach(function(key) {
|
Object.keys(optionHash).forEach(function(key) {
|
||||||
this.setDefaultValue(path, key, optionHash[key]);
|
this.setDefaultValue(path, key, optionHash[key]);
|
||||||
});
|
}, this);
|
||||||
};
|
};
|
||||||
|
|
||||||
this.warn = warn;
|
this.warn = warn;
|
||||||
|
|
|
||||||
|
|
@ -150,7 +150,8 @@ function onMouseDown(e) {
|
||||||
if (isSamePoint(screenCursor, newCursor) && isSamePoint(cursor, selection.lead))
|
if (isSamePoint(screenCursor, newCursor) && isSamePoint(cursor, selection.lead))
|
||||||
return;
|
return;
|
||||||
screenCursor = newCursor;
|
screenCursor = newCursor;
|
||||||
|
|
||||||
|
editor.$blockScrolling++;
|
||||||
editor.selection.moveToPosition(cursor);
|
editor.selection.moveToPosition(cursor);
|
||||||
editor.renderer.scrollCursorIntoView();
|
editor.renderer.scrollCursorIntoView();
|
||||||
|
|
||||||
|
|
@ -160,8 +161,9 @@ function onMouseDown(e) {
|
||||||
rectSel[0] = editor.$mouseHandler.$clickSelection.clone();
|
rectSel[0] = editor.$mouseHandler.$clickSelection.clone();
|
||||||
rectSel.forEach(editor.addSelectionMarker, editor);
|
rectSel.forEach(editor.addSelectionMarker, editor);
|
||||||
editor.updateSelectionMarkers();
|
editor.updateSelectionMarkers();
|
||||||
|
editor.$blockScrolling--;
|
||||||
};
|
};
|
||||||
|
editor.$blockScrolling++;
|
||||||
if (isMultiSelect && !accel) {
|
if (isMultiSelect && !accel) {
|
||||||
selection.toSingleRange();
|
selection.toSingleRange();
|
||||||
} else if (!isMultiSelect && accel) {
|
} else if (!isMultiSelect && accel) {
|
||||||
|
|
@ -173,6 +175,7 @@ function onMouseDown(e) {
|
||||||
screenAnchor = session.documentToScreenPosition(selection.lead);
|
screenAnchor = session.documentToScreenPosition(selection.lead);
|
||||||
else
|
else
|
||||||
selection.moveToPosition(pos);
|
selection.moveToPosition(pos);
|
||||||
|
editor.$blockScrolling--;
|
||||||
|
|
||||||
screenCursor = {row: -1, column: -1};
|
screenCursor = {row: -1, column: -1};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue