diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2015-09-30 16:08:38 +0300 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-09-30 16:08:38 +0300 |
commit | 8fed9fe2232d7b456a82d1bbfccbe745553e06de (patch) | |
tree | bdf3caf408b8cd417151c67013fa4764440cac59 /js | |
parent | b3eeca866171c67a82cde11835209e7cdb482347 (diff) | |
parent | f3f9a58c8cdaa6ce23c72167ec92fdf783a97b22 (diff) |
Merge pull request #115 from owncloud/updaterowaftersave
Update file list row after save
Diffstat (limited to 'js')
-rw-r--r-- | js/editor.js | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/js/editor.js b/js/editor.js index 620a76e..d41ccc8 100644 --- a/js/editor.js +++ b/js/editor.js @@ -169,10 +169,11 @@ var Files_Texteditor = { * Handles the FileAction click event */ _onEditorTrigger: function(filename, context) { - OCA.Files_Texteditor.currentContext = context; - OCA.Files_Texteditor.file.name = filename; - OCA.Files_Texteditor.file.dir = context.dir; - OCA.Files_Texteditor.loadEditor( + this.currentContext = context; + this.file.name = filename; + this.file.dir = context.dir; + this.fileInfoModel = context.fileList.getModelForFile(filename); + this.loadEditor( OCA.Files_Texteditor.$container, OCA.Files_Texteditor.file ); @@ -240,7 +241,7 @@ var Files_Texteditor = { OCA.Files.fileActions.registerAction({ name: 'Edit', mime: value, - actionHandler: _self._onEditorTrigger, + actionHandler: _.bind(_self._onEditorTrigger, _self), permissions: OC.PERMISSION_READ }); OCA.Files.fileActions.setDefault(value, 'Edit'); @@ -345,11 +346,12 @@ var Files_Texteditor = { * Binds the control events on the control bar */ bindControlBar: function() { - $('#editor_close').on('click', this._onCloseTrigger); + var self = this; + $('#editor_close').on('click', _.bind(this._onCloseTrigger, this)); $(window).resize(OCA.Files_Texteditor.setFilenameMaxLength); if(!$('html').hasClass('ie8')) { window.onpopstate = function (e) { - OCA.Files_Texteditor._onCloseTrigger(); + self._onCloseTrigger(); } } }, @@ -512,6 +514,14 @@ var Files_Texteditor = { closeEditor: function() { this.$container.html('').show(); this.unloadControlBar(); + if (this.fileInfoModel) { + this.fileInfoModel.set({ + // temp dummy, until we can do a PROPFIND + etag: this.fileInfoModel.get('id') + this.file.mtime, + mtime: this.file.mtime * 1000, + // TODO: set size if there is a way to know + }); + } document.title = this.oldTitle; }, |