Fix bug 43877 (add display of the current color scheme)
This commit is contained in:
parent
2663514147
commit
af1d560430
|
@ -2,12 +2,8 @@
|
|||
cursor: pointer;
|
||||
display: block;
|
||||
background-color: #fff;
|
||||
.item-content {
|
||||
padding-left: 0;
|
||||
}
|
||||
.item-inner {
|
||||
justify-content: flex-start;
|
||||
padding-left: 16px;
|
||||
}
|
||||
.color-schema-block {
|
||||
display: flex;
|
||||
|
@ -22,4 +18,4 @@
|
|||
margin-left: 20px;
|
||||
color: #212121;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,12 +2,8 @@
|
|||
cursor: pointer;
|
||||
display: block;
|
||||
background-color: #fff;
|
||||
.item-content {
|
||||
padding-left: 0;
|
||||
}
|
||||
.item-inner {
|
||||
justify-content: flex-start;
|
||||
padding-left: 16px;
|
||||
}
|
||||
.color-schema-block {
|
||||
display: flex;
|
||||
|
@ -22,4 +18,4 @@
|
|||
margin-left: 20px;
|
||||
color: #212121;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -84,7 +84,6 @@ define([
|
|||
_canReview = false,
|
||||
_isReviewOnly = false,
|
||||
_fileKey,
|
||||
templateInsert,
|
||||
_metricText = Common.Utils.Metric.getCurrentMetricName(),
|
||||
_isEdit,
|
||||
_lang;
|
||||
|
@ -348,28 +347,21 @@ define([
|
|||
},
|
||||
|
||||
initPageColorSchemes: function() {
|
||||
$('#color-schemes-content').html(templateInsert);
|
||||
$('.color-schemes-menu').on('click', _.bind(this.onColorSchemaClick, this));
|
||||
this.curSchemas = (this.api) ? this.api.asc_GetCurrentColorSchemeIndex() : 0;
|
||||
this.getView('Settings').renderSchemaSettings(this.curSchemas, this.schemas);
|
||||
$('.page[data-page=color-schemes-view] input:radio[name=color-schema]').single('change', _.bind(this.onColorSchemaChange, this));
|
||||
Common.Utils.addScrollIfNeed('.page[data-page=color-schemes-view', '.page[data-page=color-schemes-view] .page-content');
|
||||
},
|
||||
|
||||
onSendThemeColorSchemes: function (schemas) {
|
||||
templateInsert = "";
|
||||
_.each(schemas, function (schema, index) {
|
||||
var colors = schema.get_colors(), //schema.colors;
|
||||
name = schema.get_name();
|
||||
templateInsert = templateInsert + "<a class='color-schemes-menu item-link no-indicator'><input type='hidden' value='" + index + "'><div class='item-content'><div class='item-inner'><span class='color-schema-block'>";
|
||||
for (var j = 2; j < 7; j++) {
|
||||
var clr = '#' + Common.Utils.ThemeColor.getHexColor(colors[j].get_r(), colors[j].get_g(), colors[j].get_b());
|
||||
templateInsert = templateInsert + "<span class='color' style='background: " + clr + ";'></span>"
|
||||
}
|
||||
templateInsert = templateInsert + "</span><span class='text'>" + name + "</span></div></div></a>";
|
||||
}, this);
|
||||
this.schemas = schemas;
|
||||
},
|
||||
|
||||
onColorSchemaClick: function(event) {
|
||||
onColorSchemaChange: function(event) {
|
||||
if (this.api) {
|
||||
var name = $(event.currentTarget).children('input').val();
|
||||
this.api.asc_ChangeColorSchemeByIdx(name);
|
||||
var ind = $(event.currentTarget).val();
|
||||
if (this.curSchemas !== ind)
|
||||
this.api.asc_ChangeColorSchemeByIdx(parseInt(ind));
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -787,9 +787,8 @@
|
|||
<div class="page" data-page="color-schemes-view">
|
||||
<div class="page-content">
|
||||
<div id="color-schemes-content" class="list-block">
|
||||
|
||||
<ul></ul>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -243,6 +243,31 @@ define([
|
|||
}
|
||||
},
|
||||
|
||||
renderSchemaSettings: function(currentSchema, arrSchemas) {
|
||||
if (arrSchemas) {
|
||||
var templateInsert = "";
|
||||
_.each(arrSchemas, function (schema, index) {
|
||||
var colors = schema.get_colors(),//schema.colors;
|
||||
name = schema.get_name();
|
||||
templateInsert += '<li class="color-schemes-menu"><label class="label-radio item-content"><input type="radio" name="color-schema" value="' + index + '"';
|
||||
if (index === currentSchema) {
|
||||
templateInsert += ' checked="checked"'
|
||||
}
|
||||
templateInsert += '>';
|
||||
if (Framework7.prototype.device.android) {
|
||||
templateInsert += '<div class="item-media"><i class="icon icon-form-radio"></i></div>';
|
||||
}
|
||||
templateInsert += '<div class="item-inner"><span class="color-schema-block">';
|
||||
for (var j = 2; j < 7; j++) {
|
||||
var clr = '#' + Common.Utils.ThemeColor.getHexColor(colors[j].get_r(), colors[j].get_g(), colors[j].get_b());
|
||||
templateInsert = templateInsert + "<span class='color' style='background: " + clr + ";'></span>"
|
||||
}
|
||||
templateInsert += '</span><span class="text">' + name + '</span></div></label></li>';
|
||||
}, this);
|
||||
$('#color-schemes-content ul').html(templateInsert);
|
||||
}
|
||||
},
|
||||
|
||||
textFindAndReplace: 'Find and Replace',
|
||||
textSettings: 'Settings',
|
||||
textDone: 'Done',
|
||||
|
|
|
@ -6372,12 +6372,8 @@ html.pixel-ratio-3 .document-menu .list-block li:last-child li .item-inner:after
|
|||
display: block;
|
||||
background-color: #fff;
|
||||
}
|
||||
.color-schemes-menu .item-content {
|
||||
padding-left: 0;
|
||||
}
|
||||
.color-schemes-menu .item-inner {
|
||||
justify-content: flex-start;
|
||||
padding-left: 16px;
|
||||
}
|
||||
.color-schemes-menu .color-schema-block {
|
||||
display: flex;
|
||||
|
|
|
@ -5965,12 +5965,8 @@ html.phone .document-menu .list-block .item-link {
|
|||
display: block;
|
||||
background-color: #fff;
|
||||
}
|
||||
.color-schemes-menu .item-content {
|
||||
padding-left: 0;
|
||||
}
|
||||
.color-schemes-menu .item-inner {
|
||||
justify-content: flex-start;
|
||||
padding-left: 16px;
|
||||
}
|
||||
.color-schemes-menu .color-schema-block {
|
||||
display: flex;
|
||||
|
|
|
@ -57,7 +57,6 @@ define([
|
|||
infoObj,
|
||||
modalView,
|
||||
_licInfo,
|
||||
templateInsert,
|
||||
_lang;
|
||||
|
||||
var _slideSizeArr = [
|
||||
|
@ -242,29 +241,22 @@ define([
|
|||
PE.getController('Common.Controllers.Collaboration').showModal();
|
||||
},
|
||||
|
||||
initPageColorSchemes: function () {
|
||||
$('#color-schemes-content').html(templateInsert);
|
||||
$('.color-schemes-menu').on('click', _.bind(this.onColorSchemaClick, this));
|
||||
initPageColorSchemes: function() {
|
||||
this.curSchemas = (this.api) ? this.api.asc_GetCurrentColorSchemeIndex() : 0;
|
||||
this.getView('Settings').renderSchemaSettings(this.curSchemas, this.schemas);
|
||||
$('.page[data-page=color-schemes-view] input:radio[name=color-schema]').single('change', _.bind(this.onColorSchemaChange, this));
|
||||
Common.Utils.addScrollIfNeed('.page[data-page=color-schemes-view', '.page[data-page=color-schemes-view] .page-content');
|
||||
},
|
||||
|
||||
onSendThemeColorSchemes: function (schemas) {
|
||||
templateInsert = "";
|
||||
_.each(schemas, function (schema, index) {
|
||||
var colors = schema.get_colors(),//schema.colors;
|
||||
name = schema.get_name();
|
||||
templateInsert = templateInsert + "<a class='color-schemes-menu item-link no-indicator'><input type='hidden' value='" + index + "'><div class='item-content'><div class='item-inner'><span class='color-schema-block'>";
|
||||
for (var j = 2; j < 7; j++) {
|
||||
var clr = '#' + Common.Utils.ThemeColor.getHexColor(colors[j].get_r(), colors[j].get_g(), colors[j].get_b());
|
||||
templateInsert = templateInsert + "<span class='color' style='background: " + clr + ";'></span>"
|
||||
}
|
||||
templateInsert = templateInsert + "</span><span class='text'>" + name + "</span></div></div></a>";
|
||||
}, this);
|
||||
this.schemas = schemas;
|
||||
},
|
||||
|
||||
onColorSchemaClick: function (event) {
|
||||
onColorSchemaChange: function(event) {
|
||||
if (this.api) {
|
||||
var name = $(event.currentTarget).children('input').val();
|
||||
this.api.asc_ChangeColorSchemeByIdx(name);
|
||||
var ind = $(event.currentTarget).val();
|
||||
if (this.curSchemas !== ind)
|
||||
this.api.asc_ChangeColorSchemeByIdx(parseInt(ind));
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -539,9 +539,8 @@
|
|||
<div class="page" data-page="color-schemes-view">
|
||||
<div class="page-content">
|
||||
<div id="color-schemes-content" class="list-block">
|
||||
|
||||
<ul></ul>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -226,6 +226,31 @@ define([
|
|||
}
|
||||
},
|
||||
|
||||
renderSchemaSettings: function(currentSchema, arrSchemas) {
|
||||
if (arrSchemas) {
|
||||
var templateInsert = "";
|
||||
_.each(arrSchemas, function (schema, index) {
|
||||
var colors = schema.get_colors(),//schema.colors;
|
||||
name = schema.get_name();
|
||||
templateInsert += '<li class="color-schemes-menu"><label class="label-radio item-content"><input type="radio" name="color-schema" value="' + index + '"';
|
||||
if (index === currentSchema) {
|
||||
templateInsert += ' checked="checked"'
|
||||
}
|
||||
templateInsert += '>';
|
||||
if (Framework7.prototype.device.android) {
|
||||
templateInsert += '<div class="item-media"><i class="icon icon-form-radio"></i></div>';
|
||||
}
|
||||
templateInsert += '<div class="item-inner"><span class="color-schema-block">';
|
||||
for (var j = 2; j < 7; j++) {
|
||||
var clr = '#' + Common.Utils.ThemeColor.getHexColor(colors[j].get_r(), colors[j].get_g(), colors[j].get_b());
|
||||
templateInsert = templateInsert + "<span class='color' style='background: " + clr + ";'></span>"
|
||||
}
|
||||
templateInsert += '</span><span class="text">' + name + '</span></div></label></li>';
|
||||
}, this);
|
||||
$('#color-schemes-content ul').html(templateInsert);
|
||||
}
|
||||
},
|
||||
|
||||
unknownText: 'Unknown',
|
||||
textSettings: 'Settings',
|
||||
textFind: 'Find',
|
||||
|
|
|
@ -6372,12 +6372,8 @@ html.pixel-ratio-3 .document-menu .list-block li:last-child li .item-inner:after
|
|||
display: block;
|
||||
background-color: #fff;
|
||||
}
|
||||
.color-schemes-menu .item-content {
|
||||
padding-left: 0;
|
||||
}
|
||||
.color-schemes-menu .item-inner {
|
||||
justify-content: flex-start;
|
||||
padding-left: 16px;
|
||||
}
|
||||
.color-schemes-menu .color-schema-block {
|
||||
display: flex;
|
||||
|
|
|
@ -5965,12 +5965,8 @@ html.phone .document-menu .list-block .item-link {
|
|||
display: block;
|
||||
background-color: #fff;
|
||||
}
|
||||
.color-schemes-menu .item-content {
|
||||
padding-left: 0;
|
||||
}
|
||||
.color-schemes-menu .item-inner {
|
||||
justify-content: flex-start;
|
||||
padding-left: 16px;
|
||||
}
|
||||
.color-schemes-menu .color-schema-block {
|
||||
display: flex;
|
||||
|
|
|
@ -53,7 +53,6 @@ define([
|
|||
infoObj,
|
||||
modalView,
|
||||
_licInfo,
|
||||
templateInsert,
|
||||
_pageSizesIndex = 0,
|
||||
_pageSizesCurrent = [0, 0],
|
||||
txtCm = Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.cm),
|
||||
|
@ -500,28 +499,21 @@ define([
|
|||
},
|
||||
|
||||
initPageColorSchemes: function() {
|
||||
$('#color-schemes-content').html(templateInsert);
|
||||
$('.color-schemes-menu').on('click', _.bind(this.onColorSchemaClick, this));
|
||||
this.curSchemas = (this.api) ? this.api.asc_GetCurrentColorSchemeIndex() : 0;
|
||||
this.getView('Settings').renderSchemaSettings(this.curSchemas, this.schemas);
|
||||
$('.page[data-page=color-schemes-view] input:radio[name=color-schema]').single('change', _.bind(this.onColorSchemaChange, this));
|
||||
Common.Utils.addScrollIfNeed('.page[data-page=color-schemes-view', '.page[data-page=color-schemes-view] .page-content');
|
||||
},
|
||||
|
||||
onSendThemeColorSchemes: function (schemas) {
|
||||
templateInsert = "";
|
||||
_.each(schemas, function (schema, index) {
|
||||
var colors = schema.get_colors(),//schema.colors;
|
||||
name = schema.get_name();
|
||||
templateInsert = templateInsert + "<a class='color-schemes-menu item-link no-indicator'><input type='hidden' value='" + index + "'><div class='item-content'><div class='item-inner'><span class='color-schema-block'>";
|
||||
for (var j = 2; j < 7; j++) {
|
||||
var clr = '#' + Common.Utils.ThemeColor.getHexColor(colors[j].get_r(), colors[j].get_g(), colors[j].get_b());
|
||||
templateInsert = templateInsert + "<span class='color' style='background: " + clr + ";'></span>"
|
||||
}
|
||||
templateInsert = templateInsert + "</span><span class='text'>" + name + "</span></div></div></a>";
|
||||
}, this);
|
||||
this.schemas = schemas;
|
||||
},
|
||||
|
||||
onColorSchemaClick: function(event) {
|
||||
onColorSchemaChange: function(event) {
|
||||
if (this.api) {
|
||||
var name = $(event.currentTarget).children('input').val();
|
||||
this.api.asc_ChangeColorSchemeByIdx(name);
|
||||
var ind = $(event.currentTarget).val();
|
||||
if (this.curSchemas !== ind)
|
||||
this.api.asc_ChangeColorSchemeByIdx(parseInt(ind));
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -700,9 +700,8 @@
|
|||
<div class="page" data-page="color-schemes-view">
|
||||
<div class="page-content">
|
||||
<div id="color-schemes-content" class="list-block">
|
||||
|
||||
<ul></ul>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -335,6 +335,32 @@ define([
|
|||
|
||||
},
|
||||
|
||||
renderSchemaSettings: function(currentSchema, arrSchemas) {
|
||||
if (arrSchemas) {
|
||||
var templateInsert = "";
|
||||
_.each(arrSchemas, function (schema, index) {
|
||||
var colors = schema.get_colors(),//schema.colors;
|
||||
name = schema.get_name();
|
||||
templateInsert += '<li class="color-schemes-menu"><label class="label-radio item-content"><input type="radio" name="color-schema" value="' + index + '"';
|
||||
if (index === currentSchema) {
|
||||
templateInsert += ' checked="checked"'
|
||||
}
|
||||
templateInsert += '>';
|
||||
if (Framework7.prototype.device.android) {
|
||||
templateInsert += '<div class="item-media"><i class="icon icon-form-radio"></i></div>';
|
||||
}
|
||||
templateInsert += '<div class="item-inner"><span class="color-schema-block">';
|
||||
for (var j = 2; j < 7; j++) {
|
||||
var clr = '#' + Common.Utils.ThemeColor.getHexColor(colors[j].get_r(), colors[j].get_g(), colors[j].get_b());
|
||||
templateInsert = templateInsert + "<span class='color' style='background: " + clr + ";'></span>"
|
||||
}
|
||||
templateInsert += '</span><span class="text">' + name + '</span></div></label></li>';
|
||||
}, this);
|
||||
$('#color-schemes-content ul').html(templateInsert);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
unknownText: 'Unknown',
|
||||
textFindAndReplace: 'Find and Replace',
|
||||
textSettings: 'Settings',
|
||||
|
|
|
@ -6372,12 +6372,8 @@ html.pixel-ratio-3 .document-menu .list-block li:last-child li .item-inner:after
|
|||
display: block;
|
||||
background-color: #fff;
|
||||
}
|
||||
.color-schemes-menu .item-content {
|
||||
padding-left: 0;
|
||||
}
|
||||
.color-schemes-menu .item-inner {
|
||||
justify-content: flex-start;
|
||||
padding-left: 16px;
|
||||
}
|
||||
.color-schemes-menu .color-schema-block {
|
||||
display: flex;
|
||||
|
|
|
@ -5975,12 +5975,8 @@ html.phone .document-menu .list-block .item-link {
|
|||
display: block;
|
||||
background-color: #fff;
|
||||
}
|
||||
.color-schemes-menu .item-content {
|
||||
padding-left: 0;
|
||||
}
|
||||
.color-schemes-menu .item-inner {
|
||||
justify-content: flex-start;
|
||||
padding-left: 16px;
|
||||
}
|
||||
.color-schemes-menu .color-schema-block {
|
||||
display: flex;
|
||||
|
|
Loading…
Reference in a new issue