fixed shadow image with scaling...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2014-10-17 15:11:23 +04:00
parent 019956c777
commit 4f5b432c08
2 changed files with 18 additions and 7 deletions

View File

@ -31,12 +31,16 @@
overflow: visible;
width: auto;
height: auto;
background: black;
-webkit-transition: all 0.1s ease-in;
-moz-transition: all 0.1s ease-in;
transition: all 0.1s ease-in;
}
.shadow .image {
transform-origin: 0 0;
}
.image.moving {
visibility: hidden;
}

View File

@ -314,22 +314,29 @@ module.RibbonsPrototype = {
},
// XXX make this work for multiple targets...
// XXX avoid ardcoded delays...
// XXX avoid hardcoded delays...
makeShadow: function(target, animate){
var img = this.getImage(target)
var gid = this.getElemGID(img)
var s = this.getScale()
var shadow = $('<div>')
.addClass('shadow')
.append(img
.clone()
.removeClass('current')
.attr('gid', null))
.css(img.offset())
.addClass('shadow')
.append(setElementScale(
img
.clone()
.removeClass('current')
.attr('gid', null), s))
.css({
width: img.width()*s,
height: img.height()*s,
})
.css(img.offset())
.appendTo(this.viewer)
img.addClass('moving')
var that = this
return function(){
var s = that.getScale()
var img = that.getImage(gid)
if(animate){
shadow.css(img.offset())