forked from 0x2620/oxjs
better icon loading for firefox
This commit is contained in:
parent
34f655104a
commit
1d00e6dc2e
6 changed files with 29 additions and 17 deletions
|
|
@ -5719,7 +5719,7 @@ requires
|
|||
height: self.options.size * 1.5,
|
||||
lineLength: self.options.size == 64 ? 17 : 23,
|
||||
lines: self.options.size == 64 ? 4 : 5,
|
||||
url: oxui.path + '/png/ox.ui.' + Ox.theme() + '/icon.png',
|
||||
url: oxui.path + '/png/ox.ui/transparent.png',
|
||||
width: self.options.size
|
||||
});
|
||||
self.title = formatText(self.options.title, self.lines - 1, self.lineLength);
|
||||
|
|
@ -5732,14 +5732,14 @@ requires
|
|||
that.$icon = $('<div>')
|
||||
.addClass('OxIcon')
|
||||
.css({
|
||||
top: self.options.size == 64 ? -68 : -120,
|
||||
top: self.options.size == 64 ? -72 : -124,
|
||||
width: (self.options.size + 4) + 'px',
|
||||
height: self.options.size + 'px'
|
||||
height: (self.options.size + 4) + 'px'
|
||||
});
|
||||
that.$iconImage = $('<img>')
|
||||
.addClass('OxLoading OxTarget')
|
||||
.attr({
|
||||
src: self.options.url
|
||||
src: self.url
|
||||
})
|
||||
.css({
|
||||
width: self.options.width + 'px',
|
||||
|
|
@ -5748,7 +5748,7 @@ requires
|
|||
.mousedown(mousedown)
|
||||
.mouseenter(mouseenter)
|
||||
.mouseleave(mouseleave)
|
||||
.load(load);
|
||||
.one('load', load);
|
||||
that.$textBox = $('<div>')
|
||||
.addClass('OxText')
|
||||
.css({
|
||||
|
|
@ -5770,17 +5770,19 @@ requires
|
|||
.addClass('OxReflection')
|
||||
.css({
|
||||
top: self.options.size + 'px',
|
||||
width: self.options.size + 'px',
|
||||
width: (self.options.size + 4) + 'px',
|
||||
height: (self.options.size / 2) + 'px'
|
||||
});
|
||||
that.$reflectionImage = $('<img>')
|
||||
.addClass('OxLoading')
|
||||
.attr({
|
||||
src: self.options.url
|
||||
src: self.url
|
||||
})
|
||||
.css({
|
||||
width: self.options.width + 'px',
|
||||
height: self.options.height + 'px'
|
||||
height: self.options.height + 'px',
|
||||
// firefox is 1px off when centering images with odd width and scaleY(-1)
|
||||
paddingLeft: ($.browser.mozilla && self.options.width % 2 ? 1 : 0) + 'px'
|
||||
});
|
||||
that.$gradient = $('<div>')
|
||||
.css({
|
||||
|
|
@ -5821,8 +5823,16 @@ requires
|
|||
}
|
||||
|
||||
function load() {
|
||||
that.$iconImage.removeClass('OxLoading');
|
||||
that.$reflectionImage.removeClass('OxLoading');
|
||||
that.$iconImage.attr({
|
||||
src: self.options.url
|
||||
})
|
||||
.one('load', function() {
|
||||
that.$iconImage.removeClass('OxLoading');
|
||||
that.$reflectionImage.removeClass('OxLoading');
|
||||
});
|
||||
that.$reflectionImage.attr({
|
||||
src: self.options.url
|
||||
});
|
||||
}
|
||||
|
||||
function mousedown(e) {
|
||||
|
|
@ -6071,9 +6081,11 @@ requires
|
|||
}
|
||||
|
||||
function getPage() {
|
||||
return self.options.orientation == 'horizontal'
|
||||
? Math.floor((that.scrollLeft() - self.listMargin / 2) / self.pageWidth)
|
||||
: Math.floor((that.scrollTop() - self.listMargin / 2) / self.pageHeight);
|
||||
return Math.max(
|
||||
Math.floor(self.options.orientation == 'horizontal' ?
|
||||
(that.scrollLeft() - self.listMargin / 2) / self.pageWidth :
|
||||
(that.scrollTop() - self.listMargin / 2) / self.pageHeight
|
||||
), 0);
|
||||
}
|
||||
|
||||
function getPositions() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue