Fix Bug 37714

This commit is contained in:
Julia Radzhabova 2018-06-21 16:31:21 +03:00
parent c730f5a60e
commit 9415bc03de
9 changed files with 152 additions and 5 deletions

View file

@ -175,8 +175,10 @@ define([
if (_shapeObject) {
if (pageId == '#edit-shape-wrap') {
me._initWrapView();
} else if (pageId == '#edit-shape-style' || pageId == '#edit-shape-border-color-view') {
} else if (pageId == '#edit-shape-style' || pageId == '#edit-shape-style-nofill' || pageId == '#edit-shape-border-color-view') {
me._initStyleView();
} else {
me.getView('EditShape').isShapeCanFill = _shapeObject.get_ShapeProperties().get_CanFill();
}
}
},
@ -534,6 +536,7 @@ define([
if (shapes.length > 0) {
var object = shapes[shapes.length - 1]; // get top shape
_shapeObject = object.get_ObjectValue();
this.getView('EditShape').isShapeCanFill = _shapeObject.get_ShapeProperties().get_CanFill();
} else {
_shapeObject = undefined;
}

View file

@ -393,6 +393,47 @@
</div>
</div>
<div id="edit-shape-style-nofill">
<div class="navbar">
<div class="navbar-inner edit-shape-style" data-page="edit-shape-style">
<div class="left sliding"><a href="#" class="back link"><i class="icon icon-back"></i><% if (!android) { %><span><%= scope.textBack %></span><% } %></a></div>
<div class="center sliding"><%= scope.textBorder %></div>
<div class="right"><% if (phone) { %><a href="#" class="link icon-only close-picker"><i class="icon icon-expand-down"></i></a><% } %></div>
</div>
</div>
<div class="page" data-page="edit-shape-style">
<div class="page-content">
<div class="list-block">
<ul>
<li id="edit-shape-bordersize">
<div style="padding: 15px 0 0 15px;"><%= scope.textSize %></div>
<div class="item-content">
<div class="item-inner">
<div class="item-input">
<div class="range-slider">
<input type="range" min="0" max="7" value="0" step="1">
</div>
</div>
<div class="item-after value">0 pt</div>
</div>
</div>
</li>
<li>
<a id="edit-shape-bordercolor" class="item-link">
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textColor %></div>
<div class="item-after"><div class="color-preview"></div></div>
</div>
</div>
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
<!-- Border color view -->
<div id="edit-shape-border-color-view">
<div class="navbar">

View file

@ -62,6 +62,7 @@ define([
initialize: function () {
Common.NotificationCenter.on('editcontainer:show', _.bind(this.initEvents, this));
Common.NotificationCenter.on('editcategory:show', _.bind(this.categoryShow, this));
this.isShapeCanFill = true;
},
initEvents: function () {
@ -142,9 +143,12 @@ define([
},
showStyle: function () {
var selector = '#edit-shape-style';
var selector = this.isShapeCanFill ? '#edit-shape-style' : '#edit-shape-style-nofill';
this.showPage(selector, true);
if (!this.isShapeCanFill)
this.showStyleCategory();
this.paletteFillColor = new Common.UI.ThemeColorPalette({
el: $('#tab-shape-fill'),
transparent: true

View file

@ -140,8 +140,10 @@ define([
// me.api && me.api.UpdateInterfaceState();
if (_shapeObject) {
if (pageId == '#edit-shape-style' || pageId == '#edit-shape-border-color-view') {
if (pageId == '#edit-shape-style' || pageId == '#edit-shape-style-nofill' || pageId == '#edit-shape-border-color-view') {
me._initStyleView();
} else {
me.getView('EditShape').isShapeCanFill = _shapeObject.get_CanFill();
}
}
},
@ -386,6 +388,7 @@ define([
if (shapes.length > 0) {
var object = shapes[shapes.length - 1]; // get top shape
_shapeObject = object.get_ObjectValue();
this.getView('EditShape').isShapeCanFill = _shapeObject.get_CanFill();
} else {
_shapeObject = undefined;
}

View file

@ -220,6 +220,47 @@
</div>
</div>
<div id="edit-shape-style-nofill">
<div class="navbar">
<div class="navbar-inner edit-shape-style" data-page="edit-shape-style">
<div class="left sliding"><a href="#" class="back link"><i class="icon icon-back"></i><% if (!android) { %><span><%= scope.textBack %></span><% } %></a></div>
<div class="center sliding"><%= scope.textBorder %></div>
<div class="right"><% if (phone) { %><a href="#" class="link icon-only close-picker"><i class="icon icon-expand-down"></i></a><% } %></div>
</div>
</div>
<div class="page" data-page="edit-shape-style">
<div class="page-content">
<div class="list-block">
<ul>
<li id="edit-shape-bordersize">
<div style="padding: 15px 0 0 15px;"><%= scope.textSize %></div>
<div class="item-content">
<div class="item-inner">
<div class="item-input">
<div class="range-slider">
<input type="range" min="0" max="7" value="0" step="1">
</div>
</div>
<div class="item-after value">0 pt</div>
</div>
</div>
</li>
<li>
<a id="edit-shape-bordercolor" class="item-link">
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textColor %></div>
<div class="item-after"><div class="color-preview"></div></div>
</div>
</div>
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
<!-- Border color view -->
<div id="edit-shape-border-color-view">
<div class="navbar">

View file

@ -62,6 +62,7 @@ define([
initialize: function () {
Common.NotificationCenter.on('editcontainer:show', _.bind(this.initEvents, this));
Common.NotificationCenter.on('editcategory:show', _.bind(this.categoryShow, this));
this.isShapeCanFill = true;
},
initEvents: function () {
@ -142,9 +143,12 @@ define([
},
showStyle: function () {
var selector = '#edit-shape-style';
var selector = this.isShapeCanFill ? '#edit-shape-style' : '#edit-shape-style-nofill';
this.showPage(selector, true);
if (!this.isShapeCanFill)
this.showStyleCategory();
this.paletteFillColor = new Common.UI.ThemeColorPalette({
el: $('#tab-shape-fill'),
transparent: true

View file

@ -136,7 +136,7 @@ define([
var me = this;
if ('#edit-shape-style' == pageId) {
if ('#edit-shape-style' == pageId || '#edit-shape-style-nofill' == pageId ) {
me.initStylePage();
} else if ('#edit-shape-border-color-view' == pageId) {
me.initBorderColorPage();
@ -151,6 +151,7 @@ define([
initRootPage: function () {
$('#shape-remove').single('click', _.bind(this.onRemoveShape, this));
this.getView('EditShape').isShapeCanFill = _shapeObject.get_ShapeProperties().asc_getCanFill();
},
initStylePage: function () {
@ -423,6 +424,8 @@ define([
};
_shapeObject = getTopObject(shapes);
if (_shapeObject)
this.getView('EditShape').isShapeCanFill = _shapeObject.get_ShapeProperties().asc_getCanFill();
},
// Helpers

View file

@ -211,6 +211,47 @@
</div>
</div>
<div id="edit-shape-style-nofill">
<div class="navbar">
<div class="navbar-inner edit-shape-style" data-page="edit-shape-style">
<div class="left sliding"><a href="#" class="back link"><i class="icon icon-back"></i><% if (!android) { %><span><%= scope.textBack %></span><% } %></a></div>
<div class="center sliding"><%= scope.textBorder %></div>
<div class="right"><% if (phone) { %><a href="#" class="link icon-only close-picker"><i class="icon icon-expand-down"></i></a><% } %></div>
</div>
</div>
<div class="page" data-page="edit-shape-style">
<div class="page-content">
<div class="list-block">
<ul>
<li id="edit-shape-bordersize">
<div style="padding: 15px 0 0 15px;"><%= scope.textSize %></div>
<div class="item-content">
<div class="item-inner">
<div class="item-input">
<div class="range-slider">
<input type="range" min="0" max="7" value="0" step="1">
</div>
</div>
<div class="item-after value">0 pt</div>
</div>
</div>
</li>
<li>
<a id="edit-shape-bordercolor" class="item-link" data-page="#edit-shape-border-color-view">
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textColor %></div>
<div class="item-after"><div class="color-preview"></div></div>
</div>
</div>
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
<!-- Border color view -->
<div id="edit-shape-border-color-view">
<div class="navbar">

View file

@ -62,6 +62,7 @@ define([
Common.NotificationCenter.on('editcontainer:show', _.bind(this.initEvents, this));
Common.NotificationCenter.on('editcategory:show', _.bind(this.categoryShow, this));
this.on('page:show', _.bind(this.updateItemHandlers, this));
this.isShapeCanFill = true;
},
initEvents: function () {
@ -153,7 +154,13 @@ define([
page = $target.data('page');
if (page && page.length > 0 ) {
if (page == '#edit-shape-style' && !this.isShapeCanFill)
page = '#edit-shape-style-nofill';
this.showPage(page);
if (!this.isShapeCanFill)
this.showStyleCategory();
}
},