diff --git a/apps/common/main/lib/view/DocumentPropertyDialog.js b/apps/common/main/lib/view/DocumentPropertyDialog.js index 1069c5b43b..8afccfa430 100644 --- a/apps/common/main/lib/view/DocumentPropertyDialog.js +++ b/apps/common/main/lib/view/DocumentPropertyDialog.js @@ -46,7 +46,7 @@ define([], function () { 'use strict'; }, options); this.template = [ - '
| ', - ' | ', - ' |
| ', - ' | ', - ' |
| ', - ' | ', - ' |
| ' + this.txtPresentationInfo + ' | ', + '', + '|
| ', + ' | ', + ' |
| ', + ' | ', + ' |
| ', + ' | ', + ' |
| ', + ' | ', + ' |
| ', + ' | ', + ' |
| ', + ' | ', + ' |
| ', + ' | ', + ' |
| ', // ' | ', // ' |
| ', + ' | ', + ' |
| ', + ' | ', + ' |
| ', + ' | ', + ' |
| ', + ' | ', + ' |
| ', + ' | ', + ' |
| ', - ' | ', + ' | ', + ' | ', + '', + ' | ', '
| ', - ' | ', - ' | ||
| ', - ' | ', - ' | ||
| ', - ' | ', - ' | ||
| ', - ' | ', - ' | ||
| ', - ' | ', - ' | ||
| ', - ' | ', - ' | ||
| ', - ' | ', - ' | ||
| ', - ' | ', - ' | ||
| ', ' | ', @@ -1290,9 +1298,13 @@ define([], function () { }); this.btnApply.on('click', _.bind(this.applySettings, this)); - this.pnlInfo = $markup.find('.flex-settings').addBack().filter('.flex-settings'); this.pnlApply = $markup.findById('#fms-flex-apply'); + this.btnAddProperty = new Common.UI.Button({ + el: $markup.findById('#fminfo-btn-add-property') + }); + this.btnAddProperty.on('click', _.bind(this.onAddPropertyClick, this)); + this.rendered = true; this.updateInfo(this.doc); @@ -1300,8 +1312,7 @@ define([], function () { this.$el = $(node).html($markup); if (_.isUndefined(this.scroller)) { this.scroller = new Common.UI.Scroller({ - el: this.pnlInfo, - suppressScrollX: true, + el: this.$el, alwaysVisibleY: true }); } @@ -1330,7 +1341,6 @@ define([], function () { updateScroller: function(destroy) { if (this.scroller) { this.scroller.update(destroy ? {} : undefined); - this.pnlInfo.toggleClass('bordered', this.scroller.isVisible()); } }, @@ -1380,6 +1390,12 @@ define([], function () { } this._ShowHideInfoItem(this.lblDate, !!value); } + + if (this.api) { + _.each(this.api.asc_getAllCustomProperties(), _.bind(function(prop, idx) { + this.renderCustomProperty(prop.asc_getName(), prop.asc_getType(), prop.asc_getValue(), idx); + }, this)); + } }, updateFileInfo: function() { @@ -1443,6 +1459,82 @@ define([], function () { this.SetDisabled(); }, + tplCustomProperty: function(name, type, value) { + if (type === AscCommon.c_oVariantTypes.vtBool) { + value = value ? this.txtYes : this.txtNo; + } + + return ' | ||
| ' + + ' | ' +
+ '' +
+ '' +
+ ' |
| ' + this.txtSpreadsheetInfo + ' | ', + '', + '|||
| ', ' | ', @@ -1581,8 +1582,35 @@ define([], function () { ' | ', ' | ', ' |
| ', + ' | ', + ' | ||
| ', + ' | ', + ' | ||
| ', + ' | ', + ' | ||
| ', + ' | ', + ' | ||
| ', + ' | ', + ' | ||
| ', ' | ', @@ -1599,41 +1627,20 @@ define([], function () { ' | ', ' | ', ' |
| ', - ' | ', + ' | ', + ' | ', + '', + ' | ', '
| ', - ' | ', - ' | ||
| ', - ' | ', - ' | ||
| ', - ' | ', - ' | ||
| ', - ' | ', - ' | ||
| ', ' | ', @@ -1762,9 +1769,13 @@ define([], function () { }); this.btnApply.on('click', _.bind(this.applySettings, this)); - this.pnlInfo = $markup.find('.flex-settings').addBack().filter('.flex-settings'); this.pnlApply = $markup.findById('#fms-flex-apply'); + this.btnAddProperty = new Common.UI.Button({ + el: $markup.findById('#fminfo-btn-add-property') + }); + this.btnAddProperty.on('click', _.bind(this.onAddPropertyClick, this)); + this.rendered = true; this.updateInfo(this.doc); @@ -1772,8 +1783,7 @@ define([], function () { this.$el = $(node).html($markup); if (_.isUndefined(this.scroller)) { this.scroller = new Common.UI.Scroller({ - el: this.pnlInfo, - suppressScrollX: true, + el: this.$el, alwaysVisibleY: true }); } @@ -1802,7 +1812,6 @@ define([], function () { updateScroller: function(destroy) { if (this.scroller) { this.scroller.update(destroy ? {} : undefined); - this.pnlInfo.toggleClass('bordered', this.scroller.isVisible()); } }, @@ -1954,6 +1963,82 @@ define([], function () { this.updateFileInfo(); }, + tplCustomProperty: function(name, type, value) { + if (type === AscCommon.c_oVariantTypes.vtBool) { + value = value ? this.txtYes : this.txtNo; + } + + return ' |
| ' + + ' | ' +
+ '' +
+ '' +
+ ' |