diff options
author | Robin Appelman <robin@icewind.nl> | 2017-08-26 17:08:24 +0300 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2017-08-26 17:08:24 +0300 |
commit | 3f4956f5157e6be04e153b4ebd6caf560d4c09c3 (patch) | |
tree | d93c4b41b9b78b02e0d232a0ff3e3b680b890724 /js | |
parent | b77f6e952bbeb415073d8e24fbb1d661c1091b56 (diff) |
Allow using hash navigation withing the editor
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'js')
-rw-r--r-- | js/editor.js | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/js/editor.js b/js/editor.js index b6177ab..a8d0147 100644 --- a/js/editor.js +++ b/js/editor.js @@ -194,9 +194,7 @@ var Files_Texteditor = { OCA.Files_Texteditor.$container, OCA.Files_Texteditor.file ); - if(!$('html').hasClass('ie8')) { - history.pushState({file:filename, dir:context.dir}, 'Editor', '#editor'); - } + history.pushState({file:filename, dir:context.dir}, 'Editor', '#editor'); }, /** @@ -322,11 +320,6 @@ var Files_Texteditor = { } else { _self.previewPluginOnChange = null; } - - // IE8 support - if(!OC.Util.hasSVGSupport()){ //replace all svg images with png images for browser that dont support svg - OC.Util.replaceSVG(); - } }, function(message){ // Oh dear @@ -425,14 +418,14 @@ var Files_Texteditor = { * Binds the control events on the control bar */ bindControlBar: function() { - var self = this; $('#editor_close').on('click', _.bind(this._onCloseTrigger, this)); $(window).resize(OCA.Files_Texteditor.setFilenameMaxLength); - if(!$('html').hasClass('ie8')) { - window.onpopstate = function () { - self._onCloseTrigger(); + window.onpopstate = function () { + var hash = location.hash.substr(1); + if (hash.substr(0, 6) !== 'editor') { + this._onCloseTrigger(); } - } + }.bind(this); }, /** |