diff --git a/CHANGELOG.md b/CHANGELOG.md
index fd3f1236c..b598ec4f3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,6 +8,8 @@
* Add customization parameter 'hideRightMenu' for hiding right panel on first loading (bug #39096)
### Document Editor
+* Search selected text
+* Add blank page
### Spreadsheet Editor
* Set print area
diff --git a/apps/common/main/lib/collection/Comments.js b/apps/common/main/lib/collection/Comments.js
index 1c9fdb4b1..2f34243d7 100644
--- a/apps/common/main/lib/collection/Comments.js
+++ b/apps/common/main/lib/collection/Comments.js
@@ -52,6 +52,7 @@ define([
Common.Collections.Comments = Backbone.Collection.extend({
model: Common.Models.Comment,
+ groups: null,
clearEditing: function () {
this.each(function(comment) {
diff --git a/apps/common/main/lib/component/Button.js b/apps/common/main/lib/component/Button.js
index 28c23636f..6076f836c 100644
--- a/apps/common/main/lib/component/Button.js
+++ b/apps/common/main/lib/component/Button.js
@@ -132,7 +132,8 @@ define([
};
ButtonsArray.prototype.setDisabled = function(disable) {
- if ( _disabled != disable ) {
+ // if ( _disabled != disable ) //bug when disable buttons outside the group
+ {
_disabled = disable;
this.forEach( function(button) {
diff --git a/apps/common/main/lib/component/Mixtbar.js b/apps/common/main/lib/component/Mixtbar.js
index 667b36449..4604dff93 100644
--- a/apps/common/main/lib/component/Mixtbar.js
+++ b/apps/common/main/lib/component/Mixtbar.js
@@ -88,7 +88,7 @@ define([
var _template_tabs =
'' +
- '<' +
+ '' +
'' +
'<% for(var i in items) { %>' +
'- >' +
+ '' +
'
';
this.$layout = $(options.template({
diff --git a/apps/common/main/lib/controller/Comments.js b/apps/common/main/lib/controller/Comments.js
index ecf6b09ad..ef24cdcf9 100644
--- a/apps/common/main/lib/controller/Comments.js
+++ b/apps/common/main/lib/controller/Comments.js
@@ -150,6 +150,8 @@ define([
this.popoverComments.comparator = function (collection) { return collection.get('time'); };
}
+ this.groupCollection = [];
+
this.view = this.createView('Common.Views.Comments', { store: this.collection });
this.view.render();
@@ -229,12 +231,12 @@ define([
this.api.asc_removeComment(id);
}
},
- onResolveComment: function (uid, id) {
+ onResolveComment: function (uid) {
var t = this,
reply = null,
addReply = null,
ascComment = buildCommentData(), // new asc_CCommentData(null),
- comment = t.findComment(uid, id);
+ comment = t.findComment(uid);
if (_.isUndefined(uid)) {
uid = comment.get('uid');
@@ -279,7 +281,7 @@ define([
onShowComment: function (id, selected) {
if (this.previewmode) return;
- var comment = this.findComment(id, undefined);
+ var comment = this.findComment(id);
if (comment) {
if (null !== comment.get('quote')) {
if (this.api) {
@@ -596,47 +598,40 @@ define([
if (filter) {
if (!this.view.isVisible()) {
this.view.needUpdateFilter = filter;
- this.filter = {
- property : filter.property,
- value : filter.value
- };
- return;
+ applyOnly = true;
}
- this.view.needUpdateFilter = false;
+ this.filter = filter;
- this.filter = {
- property : filter.property,
- value : filter.value
- };
+ var me = this,
+ comments = [];
+ this.filter.forEach(function(item){
+ if (!me.groupCollection[item])
+ me.groupCollection[item] = new Backbone.Collection([], { model: Common.Models.Comment});
+ comments = comments.concat(me.groupCollection[item].models);
+ });
+ this.collection.reset(comments);
+ this.collection.groups = this.filter;
if (!applyOnly) {
if (this.getPopover()) {
this.getPopover().hide();
}
- }
+ this.view.needUpdateFilter = false;
- var t = this, endComment = null;
-
- this.collection.each(function (model) {
- var prop = model.get(t.filter.property);
- if (prop) {
- model.set('hide', (null === prop.match(t.filter.value)), {silent: !!applyOnly});
+ var end = true;
+ for (var i = this.collection.length - 1; i >= 0; --i) {
+ if (end) {
+ this.collection.at(i).set('last', true, {silent: true});
+ } else {
+ if (this.collection.at(i).get('last')) {
+ this.collection.at(i).set('last', false, {silent: true});
+ }
+ }
+ end = false;
}
-
- if (model.get('last')) {
- model.set('last', false, {silent:!!applyOnly});
- }
-
- if (!model.get('hide')) {
- endComment = model;
- }
- });
-
- if (endComment) {
- endComment.set('last', true, {silent: !!applyOnly});
- }
- if (!applyOnly)
+ this.view.render();
this.view.update();
+ }
}
},
onAppAddComment: function (sender, to_doc) {
@@ -644,12 +639,23 @@ define([
this.addDummyComment();
},
+ addCommentToGroupCollection: function(comment) {
+ var groupname = comment.get('groupName');
+ if (!this.groupCollection[groupname])
+ this.groupCollection[groupname] = new Backbone.Collection([], { model: Common.Models.Comment});
+ this.groupCollection[groupname].push(comment);
+ },
+
// SDK
onApiAddComment: function (id, data) {
var comment = this.readSDKComment(id, data);
if (comment) {
- this.collection.push(comment);
+ if (comment.get('groupName')) {
+ this.addCommentToGroupCollection(comment);
+ (_.indexOf(this.collection.groups, comment.get('groupName'))>-1) && this.collection.push(comment);
+ } else
+ this.collection.push(comment);
this.updateComments(true);
@@ -668,12 +674,20 @@ define([
onApiAddComments: function (data) {
for (var i = 0; i < data.length; ++i) {
var comment = this.readSDKComment(data[i].asc_getId(), data[i]);
- this.collection.push(comment);
+ comment.get('groupName') ? this.addCommentToGroupCollection(comment) : this.collection.push(comment);
}
this.updateComments(true);
},
onApiRemoveComment: function (id, silentUpdate) {
+ for (var name in this.groupCollection) {
+ var store = this.groupCollection[name],
+ model = store.findWhere({uid: id});
+ if (model) {
+ store.remove(model);
+ break;
+ }
+ }
if (this.collection.length) {
var model = this.collection.findWhere({uid: id});
if (model) {
@@ -717,7 +731,7 @@ define([
replies = null,
repliesCount = 0,
dateReply = null,
- comment = this.findComment(id);
+ comment = this.findComment(id) || this.findCommentInGroup(id);
if (comment) {
t = this;
@@ -776,7 +790,7 @@ define([
}
},
onApiLockComment: function (id,userId) {
- var cur = this.findComment(id),
+ var cur = this.findComment(id) || this.findCommentInGroup(id),
user = null;
if (cur) {
@@ -792,7 +806,7 @@ define([
}
},
onApiUnLockComment: function (id) {
- var cur = this.findComment(id);
+ var cur = this.findComment(id) || this.findCommentInGroup(id);
if (cur) {
cur.set('lock', false);
this.getPopover() && this.getPopover().loadText();
@@ -999,11 +1013,6 @@ define([
// internal
updateComments: function (needRender, disableSort) {
- if (needRender && !this.view.isVisible()) {
- this.view.needRender = needRender;
- return;
- }
-
var me = this;
me.updateCommentsTime = new Date();
if (me.timerUpdateComments===undefined)
@@ -1017,6 +1026,12 @@ define([
},
updateCommentsView: function (needRender, disableSort) {
+ if (needRender && !this.view.isVisible()) {
+ this.view.needRender = needRender;
+ this.onUpdateFilter(this.filter, true);
+ return;
+ }
+
var i, end = true;
if (_.isUndefined(disableSort)) {
@@ -1024,6 +1039,8 @@ define([
}
if (needRender) {
+ this.onUpdateFilter(this.filter, true);
+
for (i = this.collection.length - 1; i >= 0; --i) {
if (end) {
this.collection.at(i).set('last', true, {silent: true});
@@ -1035,24 +1052,25 @@ define([
end = false;
}
- this.onUpdateFilter(this.filter, true);
-
this.view.render();
this.view.needRender = false;
}
this.view.update();
},
- findComment: function (uid, id) {
- if (_.isUndefined(uid)) {
- return this.collection.findWhere({id: id});
- }
-
+ findComment: function (uid) {
return this.collection.findWhere({uid: uid});
},
findPopupComment: function (id) {
return this.popoverComments.findWhere({id: id});
},
+ findCommentInGroup: function (id) {
+ for (var name in this.groupCollection) {
+ var store = this.groupCollection[name],
+ model = store.findWhere({uid: id});
+ if (model) return model;
+ }
+ },
closeEditing: function (id) {
var t = this;
@@ -1117,8 +1135,21 @@ define([
// helpers
onUpdateUsers: function() {
- var users = this.userCollection;
- this.collection.each(function (model) {
+ var users = this.userCollection,
+ hasGroup = false;
+ for (var name in this.groupCollection) {
+ hasGroup = true;
+ this.groupCollection[name].each(function (model) {
+ var user = users.findOriginalUser(model.get('userid'));
+ model.set('usercolor', (user) ? user.get('color') : null, {silent: true});
+
+ model.get('replys').forEach(function (reply) {
+ user = users.findOriginalUser(reply.get('userid'));
+ reply.set('usercolor', (user) ? user.get('color') : null, {silent: true});
+ });
+ });
+ }
+ !hasGroup && this.collection.each(function (model) {
var user = users.findOriginalUser(model.get('userid'));
model.set('usercolor', (user) ? user.get('color') : null, {silent: true});
@@ -1135,7 +1166,8 @@ define([
readSDKComment: function (id, data) {
var date = (data.asc_getOnlyOfficeTime()) ? new Date(this.stringOOToLocalDate(data.asc_getOnlyOfficeTime())) :
((data.asc_getTime() == '') ? new Date() : new Date(this.stringUtcToLocalDate(data.asc_getTime())));
- var user = this.userCollection.findOriginalUser(data.asc_getUserId());
+ var user = this.userCollection.findOriginalUser(data.asc_getUserId()),
+ groupname = id.match(/^(doc|sheet[0-9]+)_/);
var comment = new Common.Models.Comment({
uid : id,
userid : data.asc_getUserId(),
@@ -1155,7 +1187,8 @@ define([
showReplyInPopover : false,
hideAddReply : !_.isUndefined(this.hidereply) ? this.hidereply : (this.showPopover ? true : false),
scope : this.view,
- editable : this.mode.canEditComments || (data.asc_getUserId() == this.currentUserId)
+ editable : this.mode.canEditComments || (data.asc_getUserId() == this.currentUserId),
+ groupName : (groupname && groupname.length>1) ? groupname[1] : null
});
if (comment) {
var replies = this.readSDKReplies(data);
diff --git a/apps/common/main/lib/view/SearchDialog.js b/apps/common/main/lib/view/SearchDialog.js
index e266784d0..375841dd5 100644
--- a/apps/common/main/lib/view/SearchDialog.js
+++ b/apps/common/main/lib/view/SearchDialog.js
@@ -87,10 +87,10 @@
'
',
'
',
'',
- '',
+ '',
'
',
'
',
- '',
+ '',
'
',
'
',
'
',
@@ -176,12 +176,14 @@
return this;
},
- show: function(mode) {
+ show: function(mode, text) {
Common.UI.Window.prototype.show.call(this);
!this.mode && !mode && (mode = 'search');
if (mode && this.mode != mode) this.setMode(mode);
+ text && this.setSearchText(text);
+
if (this.options.markresult && this.miHighlight.checked) {
this.fireEvent('search:highlight', [this, true]);
}
@@ -271,6 +273,10 @@
}
},
+ setSearchText: function(value) {
+ this.txtSearch && this.txtSearch.val(value);
+ },
+
onShowReplace: function(e) {
this.setMode((this.mode=='replace') ? 'search' : 'replace');
diff --git a/apps/common/main/resources/img/controls/toolbarbig.png b/apps/common/main/resources/img/controls/toolbarbig.png
index f84e10e26..4972964bf 100644
Binary files a/apps/common/main/resources/img/controls/toolbarbig.png and b/apps/common/main/resources/img/controls/toolbarbig.png differ
diff --git a/apps/common/main/resources/img/controls/toolbarbig@2x.png b/apps/common/main/resources/img/controls/toolbarbig@2x.png
index 4d5486b11..bf6e5d9e4 100644
Binary files a/apps/common/main/resources/img/controls/toolbarbig@2x.png and b/apps/common/main/resources/img/controls/toolbarbig@2x.png differ
diff --git a/apps/common/main/resources/less/toolbar.less b/apps/common/main/resources/less/toolbar.less
index f633706bc..9690da191 100644
--- a/apps/common/main/resources/less/toolbar.less
+++ b/apps/common/main/resources/less/toolbar.less
@@ -108,20 +108,46 @@
.scroll {
line-height: @height-tabs;
min-width: 20px;
- text-align: center;
z-index: 1;
cursor: pointer;
- color: #fff;
+ position: relative;
+ display: flex;
+ align-items: center;
&:hover {
text-decoration: none;
}
+ &:not(:hover) {
+ &:after {
+ opacity: .8;
+ }
+ }
+
&.left{
- box-shadow: 5px 0 20px 5px @tabs-bg-color
+ box-shadow: 5px 0 20px 5px @tabs-bg-color;
+
+ &:after {
+ transform: rotate(135deg);
+ margin-left: 8px;
+ }
}
&.right{
- box-shadow: -5px 0 20px 5px @tabs-bg-color
+ box-shadow: -5px 0 20px 5px @tabs-bg-color;
+
+ &:after {
+ transform: rotate(-45deg);
+ margin-left: 4px;
+ }
+ }
+
+ @arrow-length: 8px;
+ &:after {
+ content: ' ';
+ width: @arrow-length;
+ height: @arrow-length;
+ border: solid white;
+ border-width: 0 2px 2px 0;
}
}
}
@@ -323,4 +349,5 @@
.button-normal-icon(btn-controls, 54, @toolbar-big-icon-size);
.button-normal-icon(~'x-huge .btn-select-pivot', 55, @toolbar-big-icon-size);
.button-normal-icon(~'x-huge .btn-bookmarks', 56, @toolbar-big-icon-size);
-.button-normal-icon(btn-print-area, 56, @toolbar-big-icon-size);
\ No newline at end of file
+.button-normal-icon(btn-blankpage, 57, @toolbar-big-icon-size);
+.button-normal-icon(btn-print-area, 58, @toolbar-big-icon-size);
\ No newline at end of file
diff --git a/apps/documenteditor/main/app/controller/LeftMenu.js b/apps/documenteditor/main/app/controller/LeftMenu.js
index 0fa76faae..e6b0a3018 100644
--- a/apps/documenteditor/main/app/controller/LeftMenu.js
+++ b/apps/documenteditor/main/app/controller/LeftMenu.js
@@ -535,9 +535,10 @@ define([
var mode = this.mode.isEdit ? (action || undefined) : 'no-replace';
if (this.dlgSearch.isVisible()) {
this.dlgSearch.setMode(mode);
+ this.dlgSearch.setSearchText(this.api.asc_GetSelectedText());
this.dlgSearch.focus();
} else {
- this.dlgSearch.show(mode);
+ this.dlgSearch.show(mode, this.api.asc_GetSelectedText());
}
} else this.dlgSearch['hide']();
},
diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js
index fb6a2c204..6a226d369 100644
--- a/apps/documenteditor/main/app/controller/Toolbar.js
+++ b/apps/documenteditor/main/app/controller/Toolbar.js
@@ -312,6 +312,7 @@ define([
toolbar.btnEditHeader.menu.on('item:click', _.bind(this.onEditHeaderFooterClick, this));
toolbar.mnuPageNumCurrentPos.on('click', _.bind(this.onPageNumCurrentPosClick, this));
toolbar.mnuInsertPageCount.on('click', _.bind(this.onInsertPageCountClick, this));
+ toolbar.btnBlankPage.on('click', _.bind(this.onBtnBlankPageClick, this));
toolbar.listStyles.on('click', _.bind(this.onListStyleSelect, this));
toolbar.listStyles.on('contextmenu', _.bind(this.onListStyleContextMenu, this));
toolbar.styleMenu.on('hide:before', _.bind(this.onListStyleBeforeHide, this));
@@ -746,6 +747,7 @@ define([
var in_footnote = this.api.asc_IsCursorInFootnote();
need_disable = paragraph_locked || header_locked || in_header || in_image || in_equation && !btn_eq_state || in_footnote || in_control;
toolbar.btnsPageBreak.setDisabled(need_disable);
+ toolbar.btnBlankPage.setDisabled(need_disable);
need_disable = paragraph_locked || header_locked || in_equation || control_plain;
toolbar.btnInsertShape.setDisabled(need_disable);
@@ -1856,6 +1858,14 @@ define([
Common.component.Analytics.trackEvent('ToolBar', 'Page Number');
},
+ onBtnBlankPageClick: function(btn) {
+ if (this.api)
+ this.api.asc_AddBlankPage();
+
+ Common.NotificationCenter.trigger('edit:complete', this.toolbar);
+ Common.component.Analytics.trackEvent('ToolBar', 'Blank Page');
+ },
+
onListStyleSelect: function(combo, record) {
this._state.prstyle = undefined;
if (this.api)
diff --git a/apps/documenteditor/main/app/template/Toolbar.template b/apps/documenteditor/main/app/template/Toolbar.template
index 3b15aed25..33c68c23c 100644
--- a/apps/documenteditor/main/app/template/Toolbar.template
+++ b/apps/documenteditor/main/app/template/Toolbar.template
@@ -81,6 +81,7 @@
+
diff --git a/apps/documenteditor/main/app/view/Toolbar.js b/apps/documenteditor/main/app/view/Toolbar.js
index 5a381bf10..cc084ce15 100644
--- a/apps/documenteditor/main/app/view/Toolbar.js
+++ b/apps/documenteditor/main/app/view/Toolbar.js
@@ -560,6 +560,14 @@ define([
this.paragraphControls.push(this.mnuInsertPageCount);
this.toolbarControls.push(this.btnEditHeader);
+ this.btnBlankPage = new Common.UI.Button({
+ id: 'id-toolbar-btn-blankpage',
+ cls: 'btn-toolbar x-huge icon-top',
+ iconCls: 'btn-blankpage',
+ caption: me.capBtnBlankPage
+ });
+ this.paragraphControls.push(this.btnBlankPage);
+
this.btnInsertShape = new Common.UI.Button({
id: 'tlbtn-insertshape',
cls: 'btn-toolbar x-huge icon-top',
@@ -1295,6 +1303,7 @@ define([
_injectComponent('#slot-btn-controls', this.btnContentControls);
_injectComponent('#slot-btn-columns', this.btnColumns);
_injectComponent('#slot-btn-editheader', this.btnEditHeader);
+ _injectComponent('#slot-btn-blankpage', this.btnBlankPage);
_injectComponent('#slot-btn-insshape', this.btnInsertShape);
_injectComponent('#slot-btn-insequation', this.btnInsertEquation);
_injectComponent('#slot-btn-pageorient', this.btnPageOrient);
@@ -1538,6 +1547,7 @@ define([
this.btnInsertText.updateHint(this.tipInsertText);
this.btnInsertTextArt.updateHint(this.tipInsertTextArt);
this.btnEditHeader.updateHint(this.tipEditHeader);
+ this.btnBlankPage.updateHint(this.tipBlankPage);
this.btnInsertShape.updateHint(this.tipInsertShape);
this.btnInsertEquation.updateHint(this.tipInsertEquation);
this.btnDropCap.updateHint(this.tipDropCap);
@@ -2372,7 +2382,9 @@ define([
tipControls: 'Insert content control',
mniHighlightControls: 'Highlight settings',
textNoHighlight: 'No highlighting',
- mniImageFromStorage: 'Image from Storage'
+ mniImageFromStorage: 'Image from Storage',
+ capBtnBlankPage: 'Blank Page',
+ tipBlankPage: 'Insert blank page'
}
})(), DE.Views.Toolbar || {}));
});
diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json
index d79db4e0a..55e911385 100644
--- a/apps/documenteditor/main/locale/en.json
+++ b/apps/documenteditor/main/locale/en.json
@@ -1976,5 +1976,7 @@
"DE.Views.Toolbar.txtScheme7": "Equity",
"DE.Views.Toolbar.txtScheme8": "Flow",
"DE.Views.Toolbar.txtScheme9": "Foundry",
+ "DE.Views.Toolbar.capBtnBlankPage": "Blank Page",
+ "DE.Views.Toolbar.tipBlankPage": "Insert blank page",
"DE.Views.Toolbar.mniImageFromStorage": "Image from Storage"
}
\ No newline at end of file
diff --git a/apps/presentationeditor/main/app.reporter.js b/apps/presentationeditor/main/app.reporter.js
index c8ca6aa80..2039fc2e3 100644
--- a/apps/presentationeditor/main/app.reporter.js
+++ b/apps/presentationeditor/main/app.reporter.js
@@ -108,6 +108,7 @@ require([
docInfo.put_Options(data.options);
docInfo.put_Token(data.token);
docInfo.put_Permissions( data.permissions);
+ window.document.title = 'Presenter View' + (data.title ? (' - ' + data.title) : '');
}
api.preloadReporter(data);
diff --git a/apps/presentationeditor/main/app_dev.reporter.js b/apps/presentationeditor/main/app_dev.reporter.js
index 75d204e7a..c113aff08 100644
--- a/apps/presentationeditor/main/app_dev.reporter.js
+++ b/apps/presentationeditor/main/app_dev.reporter.js
@@ -109,6 +109,7 @@ require([
docInfo.put_Options(data.options);
docInfo.put_Token(data.token);
docInfo.put_Permissions( data.permissions);
+ window.document.title = 'Presenter View' + (data.title ? (' - ' + data.title) : '');
}
api.preloadReporter(data);
diff --git a/apps/presentationeditor/main/index.reporter.html b/apps/presentationeditor/main/index.reporter.html
index 332a66b91..b056db3fc 100644
--- a/apps/presentationeditor/main/index.reporter.html
+++ b/apps/presentationeditor/main/index.reporter.html
@@ -1,7 +1,7 @@
- ONLYOFFICE Presentation Editor
+ Presenter View
diff --git a/apps/presentationeditor/main/index.reporter.html.deploy b/apps/presentationeditor/main/index.reporter.html.deploy
index 10d9bc0dd..413027433 100644
--- a/apps/presentationeditor/main/index.reporter.html.deploy
+++ b/apps/presentationeditor/main/index.reporter.html.deploy
@@ -1,7 +1,7 @@
- ONLYOFFICE Presentation Editor
+ Presenter View
diff --git a/apps/spreadsheeteditor/main/app/controller/LeftMenu.js b/apps/spreadsheeteditor/main/app/controller/LeftMenu.js
index 52092f2f8..9f190a9aa 100644
--- a/apps/spreadsheeteditor/main/app/controller/LeftMenu.js
+++ b/apps/spreadsheeteditor/main/app/controller/LeftMenu.js
@@ -151,11 +151,14 @@ define([
if (this.mode.canComments) {
this.api.asc_registerCallback('asc_onAddComment', _.bind(this.onApiAddComment, this));
this.api.asc_registerCallback('asc_onAddComments', _.bind(this.onApiAddComments, this));
- var collection = this.getApplication().getCollection('Common.Collections.Comments');
- for (var i = 0; i < collection.length; ++i) {
- if (collection.at(i).get('userid') !== this.mode.user.id) {
- this.leftMenu.markCoauthOptions('comments', true);
- break;
+ var comments = this.getApplication().getController('Common.Controllers.Comments').groupCollection;
+ for (var name in comments) {
+ var collection = comments[name];
+ for (var i = 0; i < collection.length; ++i) {
+ if (collection.at(i).get('userid') !== this.mode.user.id) {
+ this.leftMenu.markCoauthOptions('comments', true);
+ break;
+ }
}
}
}
diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js
index 79756d220..230661f1d 100644
--- a/apps/spreadsheeteditor/main/app/controller/Main.js
+++ b/apps/spreadsheeteditor/main/app/controller/Main.js
@@ -718,9 +718,7 @@ define([
if (window.styles_loaded || me.appOptions.isEditDiagram || me.appOptions.isEditMailMerge) {
clearInterval(timer_sl);
- Common.NotificationCenter.trigger('comments:updatefilter',
- {property: 'uid',
- value: new RegExp('^(doc_|sheet' + me.api.asc_getActiveWorksheetId() + '_)')});
+ Common.NotificationCenter.trigger('comments:updatefilter', ['doc', 'sheet' + me.api.asc_getActiveWorksheetId()]);
documentHolderView.createDelayedElements();
toolbarController.createDelayedElements();
@@ -1619,14 +1617,8 @@ define([
if (!this.appOptions.isEditMailMerge && !this.appOptions.isEditDiagram && window.editor_elements_prepared) {
this.application.getController('Statusbar').selectTab(index);
- if (this.appOptions.isEdit && !this.dontCloseDummyComment) {
- Common.NotificationCenter.trigger('comments:updatefilter',
- {
- property: 'uid',
- value: new RegExp('^(doc_|sheet' + this.api.asc_getWorksheetId(index) + '_)')
- },
- false // hide popover
- );
+ if (this.appOptions.canComments && !this.dontCloseDummyComment) {
+ Common.NotificationCenter.trigger('comments:updatefilter', ['doc', 'sheet' + this.api.asc_getWorksheetId(index)], false ); // hide popover
}
}
},
diff --git a/apps/spreadsheeteditor/main/app/controller/Statusbar.js b/apps/spreadsheeteditor/main/app/controller/Statusbar.js
index 73233d6d2..d7af7b851 100644
--- a/apps/spreadsheeteditor/main/app/controller/Statusbar.js
+++ b/apps/spreadsheeteditor/main/app/controller/Statusbar.js
@@ -384,9 +384,7 @@ define([
if (!_.isUndefined(silent)) {
me.api.asc_showWorksheet(items[index].inindex);
- Common.NotificationCenter.trigger('comments:updatefilter',
- {property: 'uid',
- value: new RegExp('^(doc_|sheet' + this.api.asc_getActiveWorksheetId() + '_)')});
+ Common.NotificationCenter.trigger('comments:updatefilter', ['doc', 'sheet' + this.api.asc_getActiveWorksheetId()]);
if (!_.isUndefined(destPos)) {
me.api.asc_moveWorksheet(items.length === destPos ? wc : items[destPos].inindex);
@@ -418,12 +416,7 @@ define([
this.api.asc_closeCellEditor();
this.api.asc_addWorksheet(this.createSheetName());
- Common.NotificationCenter.trigger('comments:updatefilter',
- {property: 'uid',
- value: new RegExp('^(doc_|sheet' + this.api.asc_getActiveWorksheetId() + '_)')
- },
- false // hide popover
- );
+ Common.NotificationCenter.trigger('comments:updatefilter', ['doc', 'sheet' + this.api.asc_getActiveWorksheetId()], false); // hide popover
}
Common.NotificationCenter.trigger('edit:complete', this.statusbar);
},
diff --git a/apps/spreadsheeteditor/main/app/controller/Toolbar.js b/apps/spreadsheeteditor/main/app/controller/Toolbar.js
index 044fdbe37..42faf095d 100644
--- a/apps/spreadsheeteditor/main/app/controller/Toolbar.js
+++ b/apps/spreadsheeteditor/main/app/controller/Toolbar.js
@@ -2825,17 +2825,6 @@ define([
// });
},
- onSheetChanged: function() {
- if (this.api) {
- var params = this.api.asc_getSheetViewSettings();
- var menu = this.getMenuHideOptions();
- if (menu) {
- menu.items.getAt(3).setChecked(!params.asc_getShowRowColHeaders());
- menu.items.getAt(4).setChecked(!params.asc_getShowGridLines());
- }
- }
- },
-
_disableEditOptions: function(seltype, coauth_disable) {
if (this.api.isCellEdited) return true;
if (this.api.isRangeSelection) return true;
diff --git a/apps/spreadsheeteditor/main/app/view/Statusbar.js b/apps/spreadsheeteditor/main/app/view/Statusbar.js
index b18681e4d..affc00153 100644
--- a/apps/spreadsheeteditor/main/app/view/Statusbar.js
+++ b/apps/spreadsheeteditor/main/app/view/Statusbar.js
@@ -358,7 +358,7 @@ define([
me.fireEvent('sheet:changed', [me, sindex]);
me.fireEvent('sheet:updateColors', [true]);
- Common.NotificationCenter.trigger('comments:updatefilter', {property: 'uid', value: new RegExp('^(doc_|sheet' + me.api.asc_getActiveWorksheetId() + '_)')}, false);
+ Common.NotificationCenter.trigger('comments:updatefilter', ['doc', 'sheet' + me.api.asc_getActiveWorksheetId()], false);
}
},
@@ -409,13 +409,7 @@ define([
this.fireEvent('sheet:changed', [this, tab.sheetindex]);
this.fireEvent('sheet:updateColors', [true]);
- Common.NotificationCenter.trigger('comments:updatefilter',
- {
- property: 'uid',
- value: new RegExp('^(doc_|sheet' + this.api.asc_getActiveWorksheetId() + '_)')
- },
- false // hide popover
- );
+ // Common.NotificationCenter.trigger('comments:updatefilter', ['doc', 'sheet' + this.api.asc_getActiveWorksheetId()], false); // hide popover
},
onTabMenu: function (o, index, tab) {