1
0
Fork 0
forked from 0x2620/oxjs

fix margins of static icon lists

This commit is contained in:
rlx 2011-10-08 17:19:18 +00:00
commit 2698bec700
5 changed files with 24 additions and 14 deletions

View file

@ -205,12 +205,12 @@ Ox.URL = function(options) {
var sortKeys = self.options.sortKeys[state.type][
!state.item ? 'list' : 'item'
][state.view];
return sort.map(function(sort) {
return sortKeys ? sort.map(function(sort) {
return (
Ox.getObjectById(sortKeys, sort.key).operator == sort.operator
? '' : sort.operator
) + sort.key;
}).join(',');
}).join(',') : '';
}
function constructSpan(span, state) {
@ -574,9 +574,7 @@ Ox.URL = function(options) {
}
function saveURL() {
self.previousURL = document.location.pathname
+ document.location.search
+ document.location.hash;
}
that._construct = function(state) {
@ -603,7 +601,7 @@ Ox.URL = function(options) {
pop <f> Sets the URL to the previous URL
@*/
that.pop = function() {
history.pushState(self.previousURL);
history.pushState({}, '', self.previousURL);
return that;
};
@ -632,7 +630,11 @@ Ox.URL = function(options) {
pushState(state, title, url);
}
function pushState(state, title, url) {
history.pushState(state, title, url);
self.previousURL = document.location.pathname
+ document.location.search
+ document.location.hash;
history.pushState(Ox.extend(state, {title: title}), '', url);
document.title = title;
callback && callback(state);
}
}
@ -660,7 +662,8 @@ Ox.URL = function(options) {
replaceState(state, title, url);
}
function replaceState(state, title, url) {
history.replaceState(state, title, url);
history.replaceState(Ox.extend(state, {title: title}), '', url);
document.title = title;
callback && callback(state);
}
}

View file

@ -192,6 +192,13 @@ Ox.List = function(options, self) {
}
if (!self.isAsync) {
self.$page = Ox.Element()
.addClass('OxPage')
.css({
left: self.listMargin / 2 + 'px',
top: self.listMargin / 2 + 'px'
})
.appendTo(that.$content);
self.listLength = self.options.items.length;
loadItems();
} else {
@ -678,7 +685,7 @@ Ox.List = function(options, self) {
}
function loadItems() {
that.$content.empty();
self.$page.empty();
self.$items = [];
self.options.items.forEach(function(item, pos) {
// fixme: duplicated
@ -689,7 +696,7 @@ Ox.List = function(options, self) {
unique: self.options.unique
});
isSelected(pos) && self.$items[pos].addClass('OxSelected');
self.$items[pos].appendTo(that.$content);
self.$items[pos].appendTo(self.$page);
});
self.selected.length && scrollToPosition(self.selected[0]);
// that.triggerEvent('init', {items: self.options.items.length});