position clear button via css

This commit is contained in:
vitalets 2013-04-14 23:29:23 +04:00
parent 2c89198cc9
commit 25bf2a360f
3 changed files with 18 additions and 15 deletions

@ -113,7 +113,11 @@
position: absolute;
opacity: 0.6;
z-index: 100;
top: 50%;
right: 5px;
margin-top: -7px;
}
.editable-clear-x:hover {

@ -136,16 +136,16 @@ Number
},
postrender: function() {
if(this.$clear) {
//increase right ffset for up/down arrows
this.$clear.css({right: 24});
/*
//can position clear button only here, when form is shown and height can be calculated
var h = this.$input.outerHeight() || 20,
var h = this.$input.outerHeight(true) || 20,
delta = (h - this.$clear.height()) / 2;
//workaround for plain-popup
if(delta < 3) {
delta = 3;
}
//add 12px to offset right for up/down arrows
this.$clear.css({bottom: delta, right: delta + 12});
this.$clear.css({top: delta, right: delta + 16});
*/
}
}
});

@ -67,18 +67,17 @@ $(function(){
},
postrender: function() {
/*
//now `clear` is positioned via css
if(this.$clear) {
//can position clear button only here, when form is shown and height can be calculated
var h = this.$input.outerHeight() || 20,
// var h = this.$input.outerHeight(true) || 20,
var h = this.$clear.parent().height(),
delta = (h - this.$clear.height()) / 2;
//workaround for plain-popup
if(delta < 3) {
delta = 3;
}
this.$clear.css({bottom: delta, right: delta});
}
//this.$clear.css({bottom: delta, right: delta});
}
*/
},
//show / hide clear button