[PE] Fix rendering themes (on retina)
This commit is contained in:
parent
5a2d2abe6c
commit
135d353220
|
@ -1960,23 +1960,18 @@ define([
|
||||||
me.toolbar.listTheme.menuPicker.store.reset([]); // remove all
|
me.toolbar.listTheme.menuPicker.store.reset([]); // remove all
|
||||||
|
|
||||||
var themeStore = this.getCollection('SlideThemes'),
|
var themeStore = this.getCollection('SlideThemes'),
|
||||||
mainController = this.getApplication().getController('Main'),
|
mainController = this.getApplication().getController('Main');
|
||||||
imageUrl = (window.devicePixelRatio > 1) ? '../../../../sdkjs/common/Images/themes_thumbnail@2x.png' : '../../../../sdkjs/common/Images/themes_thumbnail.png';
|
|
||||||
if (themeStore) {
|
if (themeStore) {
|
||||||
var arr1 = [], arr2 = [];
|
var arr1 = [], arr2 = [];
|
||||||
_.each(defaultThemes, function(theme, index) {
|
_.each(defaultThemes, function(theme, index) {
|
||||||
var tip = mainController.translationTable[theme.get_Name()] || theme.get_Name();
|
var tip = mainController.translationTable[theme.get_Name()] || theme.get_Name();
|
||||||
arr1.push(new Common.UI.DataViewModel({
|
arr1.push(new Common.UI.DataViewModel({
|
||||||
imageUrl: imageUrl,
|
|
||||||
uid : Common.UI.getId(),
|
uid : Common.UI.getId(),
|
||||||
themeId : theme.get_Index(),
|
themeId : theme.get_Index(),
|
||||||
tip : tip,
|
tip : tip,
|
||||||
itemWidth : 85,
|
|
||||||
itemHeight : 38,
|
|
||||||
offsety : index * 38
|
offsety : index * 38
|
||||||
}));
|
}));
|
||||||
arr2.push({
|
arr2.push({
|
||||||
imageUrl: imageUrl,
|
|
||||||
uid : Common.UI.getId(),
|
uid : Common.UI.getId(),
|
||||||
themeId : theme.get_Index(),
|
themeId : theme.get_Index(),
|
||||||
tip : tip,
|
tip : tip,
|
||||||
|
@ -1991,8 +1986,6 @@ define([
|
||||||
uid : Common.UI.getId(),
|
uid : Common.UI.getId(),
|
||||||
themeId : theme.get_Index(),
|
themeId : theme.get_Index(),
|
||||||
tip : tip,
|
tip : tip,
|
||||||
itemWidth : 85,
|
|
||||||
itemHeight : 38,
|
|
||||||
offsety : 0
|
offsety : 0
|
||||||
}));
|
}));
|
||||||
arr2.push({
|
arr2.push({
|
||||||
|
|
|
@ -2031,8 +2031,8 @@ define([
|
||||||
style: 'max-height: 300px;',
|
style: 'max-height: 300px;',
|
||||||
store : PE.getCollection('SlideThemes'),
|
store : PE.getCollection('SlideThemes'),
|
||||||
itemTemplate: _.template([
|
itemTemplate: _.template([
|
||||||
'<div class="style" id="<%= id %>" style="width: <%= itemWidth %>px;">',
|
'<div class="style" id="<%= id %>"">',
|
||||||
'<div style="background-image: url(<%= imageUrl %>); width: <%= itemWidth %>px; height: <%= itemHeight %>px;background-position: 0 -<%= offsety %>px;background-size: cover;"/>',
|
'<div class="item-theme" style="' + '<% if (typeof imageUrl !== "undefined") { %>' + 'background-image: url(<%= imageUrl %>);' + '<% } %> background-position: 0 -<%= offsety %>px;"/>',
|
||||||
'</div>'
|
'</div>'
|
||||||
].join(''))
|
].join(''))
|
||||||
}).on('item:click', function(picker, item, record, e) {
|
}).on('item:click', function(picker, item, record, e) {
|
||||||
|
|
|
@ -804,12 +804,12 @@ define([
|
||||||
|
|
||||||
me.listTheme.fieldPicker.itemTemplate = _.template([
|
me.listTheme.fieldPicker.itemTemplate = _.template([
|
||||||
'<div class="style" id="<%= id %>">',
|
'<div class="style" id="<%= id %>">',
|
||||||
'<div style="background-image: url(<%= imageUrl %>); width: ' + me.listTheme.itemWidth + 'px; height: ' + me.listTheme.itemHeight + 'px; background-position: 0 -<%= offsety %>px;"/>',
|
'<div class="item-theme" style="' + '<% if (typeof imageUrl !== "undefined") { %>' + 'background-image: url(<%= imageUrl %>);' + '<% } %> background-position: 0 -<%= offsety %>px;"/>',
|
||||||
'</div>'
|
'</div>'
|
||||||
].join(''));
|
].join(''));
|
||||||
me.listTheme.menuPicker.itemTemplate = _.template([
|
me.listTheme.menuPicker.itemTemplate = _.template([
|
||||||
'<div class="style" id="<%= id %>">',
|
'<div class="style" id="<%= id %>">',
|
||||||
'<div style="background-image: url(<%= imageUrl %>); width: ' + me.listTheme.itemWidth + 'px; height: ' + me.listTheme.itemHeight + 'px; background-position: 0 -<%= offsety %>px;"/>',
|
'<div class="item-theme" style="' + '<% if (typeof imageUrl !== "undefined") { %>' + 'background-image: url(<%= imageUrl %>);' + '<% } %> background-position: 0 -<%= offsety %>px;"/>',
|
||||||
'</div>'
|
'</div>'
|
||||||
].join(''));
|
].join(''));
|
||||||
|
|
||||||
|
|
|
@ -332,4 +332,11 @@
|
||||||
z-index: @zindex-dropdown - 20;
|
z-index: @zindex-dropdown - 20;
|
||||||
background-color: @gray-light;
|
background-color: @gray-light;
|
||||||
border: 1px solid @gray;
|
border: 1px solid @gray;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.item-theme {
|
||||||
|
width: 85px;
|
||||||
|
height: 38px;
|
||||||
|
.background-ximage('../../../../../../sdkjs/common/Images/themes_thumbnail.png', '../../../../../../sdkjs/common/Images/themes_thumbnail@2x.png', 85px);
|
||||||
|
background-size: cover
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue