Skip to content

Commit

Permalink
下浮动 bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
bugluo committed Sep 20, 2017
1 parent a015108 commit 06f51e3
Showing 1 changed file with 31 additions and 25 deletions.
56 changes: 31 additions & 25 deletions WeSketch.sketchplugin/Contents/Sketch/preview.html
Original file line number Diff line number Diff line change
Expand Up @@ -2444,34 +2444,39 @@
if (ua.match(/MicroMessenger/i) == "micromessenger") {
$('.wechat').show();
} else {
if (navigator.standalone || ua.indexOf('iphone') == -1 ) {
$('.icon').hide();
$('.loadding').show();
var loader = new PxLoader();
for (var i in content) {
if(i == 'width'){
continue;
}
if (content[i].content.name) {
loader.addImage('./' + content[i].content.name + '.png');
}
for (var k in content[i].children) {
if (content[i].children[k].image) {
loader.addImage('./' + content[i].children[k].image + '.png');
}
if (!navigator.standalone) {
$('.icon').show();
setTimeout(function(){
$('.icon').hide();
},8000)
}
$('.loadding').show();
var loader = new PxLoader();
for (var i in content) {
if(i == 'width'){
continue;
}
if (content[i].content.name) {
loader.addImage('./' + content[i].content.name + '.png');
}
for (var k in content[i].children) {
if (content[i].children[k].image) {
loader.addImage('./' + content[i].children[k].image + '.png');
}
}
loader.addCompletionListener(function () {
$('.loadding').remove();
$('#wrapper').show();
});
loader.start();
}else{
$('.icon').show();
}
loader.addCompletionListener(function () {
$('.loadding').remove();
$('#wrapper').show();
});
loader.start();
}
})

$('.icon').click(function(){
$('.icon').hide();
})



var size = content.width;
Expand Down Expand Up @@ -2554,9 +2559,10 @@
} else {
dom.push('position:absolute;');
}
dom.push('top:' + ((Math.floor(rx * content[i].children[k].y))-{{local}}) + 'px;');
if (content[i].children[k].yy) {
dom.push('bottom:' + ((Math.floor(rx * content[i].children[k].yy))-{{local}}) + 'px;');
dom.push('bottom:' + ((Math.floor(rx * content[i].children[k].yy))+{{local}}) + 'px;');
}else{
dom.push('top:' + ((Math.floor(rx * content[i].children[k].y))-{{local}}) + 'px;');
}
dom.push('z-index:1"></div>');
}
Expand Down Expand Up @@ -2807,4 +2813,4 @@

</body>

</html>
</html>

0 comments on commit 06f51e3

Please sign in to comment.