Skip to content

Commit

Permalink
Cleaned up legacy code for IE8
Browse files Browse the repository at this point in the history
  • Loading branch information
josdejong committed Nov 15, 2013
1 parent 3556838 commit 65c0c48
Show file tree
Hide file tree
Showing 13 changed files with 102 additions and 431 deletions.
5 changes: 5 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
http://jsoneditoronline.org


## not yet released, version 2.3.4

- Dropped support for IE8, cleaned up legacy code for old browsers.


## 2013-10-17, version 2.3.3

- Added support for search (Ctrl+F) in the code editor Ace.
Expand Down
9 changes: 4 additions & 5 deletions app/web/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ app.load = function() {
var domOpen = document.getElementById('open');
var domOpenMenuButton = document.getElementById('openMenuButton');
domOpen.onclick = function (event) {
event = event || window.event; // for IE8
var target = event.target || event.srcElement;
if (target == domOpenMenuButton ||
(event.offsetX > domOpen.offsetWidth - domOpenMenuButton.offsetWidth)) {
Expand All @@ -174,16 +173,16 @@ app.load = function() {
var domMenuOpenFile = document.getElementById('menuOpenFile');
domMenuOpenFile.onclick = function (event) {
app.openFile();
jsoneditor.util.stopPropagation(event);
jsoneditor.util.preventDefault(event);
event.stopPropagation();
event.preventDefault();
};

// menu button open url
var domMenuOpenUrl = document.getElementById('menuOpenUrl');
domMenuOpenUrl.onclick = function (event) {
app.openUrl();
jsoneditor.util.stopPropagation(event);
jsoneditor.util.preventDefault(event);
event.stopPropagation();
event.preventDefault();
};

// save button
Expand Down
10 changes: 4 additions & 6 deletions app/web/fileretriever.js
Original file line number Diff line number Diff line change
Expand Up @@ -399,12 +399,11 @@ FileRetriever.prototype.prompt = function (params) {
};

var onKeyDown = jsoneditor.util.addEventListener(document, 'keydown', function (event) {
event = event || window.event;
var keynum = event.which || event.keyCode;
var keynum = event.which;
if (keynum == 27) { // ESC
onCancel();
jsoneditor.util.preventDefault(event);
jsoneditor.util.stopPropagation(event);
event.preventDefault();
event.stopPropagation();
}
});

Expand Down Expand Up @@ -484,8 +483,7 @@ FileRetriever.prototype.prompt = function (params) {
background.className = 'fileretriever-background';
background.appendChild(border);
background.onclick = function (event) {
event = event || window.event;
var target = event.target || event.srcElement;
var target = event.target;
if (target == background) {
onCancel();
}
Expand Down
7 changes: 3 additions & 4 deletions app/web/notify.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,11 @@ Notify.prototype.removeMessage = function (message) {
* @private
*/
Notify.prototype.onKeyDown = function (event) {
event = event || window.event;
var keynum = event.which || event.keyCode;
var keynum = event.which;
if (keynum == 27) { // ESC
// remove the oldest open and closeable message
this.removeMessage();
jsoneditor.util.preventDefault(event);
jsoneditor.util.stopPropagation(event);
event.preventDefault();
event.stopPropagation();
}
};
12 changes: 6 additions & 6 deletions app/web/splitter.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ Splitter.prototype.onMouseDown = function (event) {
this.params.changed = false;
this.params.value = this.getValue();
}
jsoneditor.util.preventDefault(event);
jsoneditor.util.stopPropagation(event);
event.preventDefault();
event.stopPropagation();
};

/**
Expand All @@ -81,8 +81,8 @@ Splitter.prototype.onMouseMove = function (event) {
this.onChange(value);
}

jsoneditor.util.preventDefault(event);
jsoneditor.util.stopPropagation(event);
event.preventDefault();
event.stopPropagation();
};

/**
Expand Down Expand Up @@ -113,8 +113,8 @@ Splitter.prototype.onMouseUp = function (event) {
}
}
}
jsoneditor.util.preventDefault(event);
jsoneditor.util.stopPropagation(event);
event.preventDefault();
event.stopPropagation();
};

/**
Expand Down
5 changes: 2 additions & 3 deletions jsoneditor-min.js

Large diffs are not rendered by default.

Loading

0 comments on commit 65c0c48

Please sign in to comment.