[scaling] changed button's svg icon adding for 2.5x
This commit is contained in:
parent
6fdaf5b14d
commit
b70d36efad
|
@ -353,16 +353,20 @@ define([
|
||||||
if ( e.matches ) {
|
if ( e.matches ) {
|
||||||
console.log('scaling 250%');
|
console.log('scaling 250%');
|
||||||
|
|
||||||
|
if ( !me.$el.find('svg.icon').length ) {
|
||||||
const re_icon_name = /btn-[^\s]+/.exec(me.iconCls);
|
const re_icon_name = /btn-[^\s]+/.exec(me.iconCls);
|
||||||
const icon_name = re_icon_name ? re_icon_name[0] : "null";
|
const icon_name = re_icon_name ? re_icon_name[0] : "null";
|
||||||
const svg_icon = `<svg class="icon"><use class="zoom-int" href="#${icon_name}"></use></svg>`;
|
const svg_icon = `<svg class="icon"><use class="zoom-int" href="#${icon_name}"></use></svg>`;
|
||||||
|
|
||||||
me.$el.find('i.icon').replaceWith(svg_icon);
|
me.$el.find('i.icon').after(svg_icon);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
console.log('scaling less than 250%');
|
console.log('scaling less than 250%');
|
||||||
|
|
||||||
|
if ( !me.$el.find('i.icon') ) {
|
||||||
const png_icon = `<i class="icon ${me.iconCls}"> </i>`;
|
const png_icon = `<i class="icon ${me.iconCls}"> </i>`;
|
||||||
me.$el.find('svg.icon').replaceWith(png_icon);
|
me.$el.find('svg.icon').after(png_icon);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
@ -187,11 +187,16 @@ var utils = new(function() {
|
||||||
if ( !/pixel-ratio__1_75/.test(classes) ) {
|
if ( !/pixel-ratio__1_75/.test(classes) ) {
|
||||||
document.body.className = clear_list + ' pixel-ratio__1_75';
|
document.body.className = clear_list + ' pixel-ratio__1_75';
|
||||||
}
|
}
|
||||||
} else {
|
} else
|
||||||
$root.addClass('pixel-ratio__2');
|
if ( !(scale.devicePixelRatio < 2) && scale.devicePixelRatio < 2.5 ) {
|
||||||
if ( !/pixel-ratio__2/.test(classes) ) {
|
if ( !/pixel-ratio__2\b/.test(classes) ) {
|
||||||
document.body.className = clear_list + ' pixel-ratio__2';
|
document.body.className = clear_list + ' pixel-ratio__2';
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
// $root.addClass('pixel-ratio__2_5');
|
||||||
|
if ( !/pixel-ratio__2_5/.test(classes) ) {
|
||||||
|
document.body.className = clear_list + ' pixel-ratio__2_5';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
me.zoom = scale.correct ? scale.zoom : 1;
|
me.zoom = scale.correct ? scale.zoom : 1;
|
||||||
|
|
|
@ -424,8 +424,8 @@
|
||||||
only screen and (-webkit-min-device-pixel-ratio: 1.5) and (-webkit-max-device-pixel-ratio: 1.9),
|
only screen and (-webkit-min-device-pixel-ratio: 1.5) and (-webkit-max-device-pixel-ratio: 1.9),
|
||||||
only screen and (min-resolution: 1.5dppx) and (max-resolution: 1.9dppx),
|
only screen and (min-resolution: 1.5dppx) and (max-resolution: 1.9dppx),
|
||||||
only screen and (min-resolution: 144dpi) and (max-resolution: 143dpi) {
|
only screen and (min-resolution: 144dpi) and (max-resolution: 143dpi) {
|
||||||
width:calc(~"28px/1.5");
|
//width:calc(~"28px/1.5");
|
||||||
height:calc(~"28px/1.5");
|
//height:calc(~"28px/1.5");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -474,6 +474,16 @@
|
||||||
&.align-left {
|
&.align-left {
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.pixel-ratio__2_5 & {
|
||||||
|
i.icon {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
& svg.icon:not(.pixel-ratio__2_5 *) {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-category {
|
.btn-category {
|
||||||
|
|
Loading…
Reference in a new issue