Some style improvments.

This commit is contained in:
Lars Jung 2012-10-19 23:52:18 +02:00
parent 796e508635
commit f97a4e490b
4 changed files with 22 additions and 7 deletions

View File

@ -11,6 +11,7 @@
#extended {
display: none;
margin: 0 auto;
a, a:active, a:visited {
color: #333;

View File

@ -25,7 +25,7 @@ body {
#extended.view-icons {
padding: 0;
border: none;
margin: 0 -14px;
// margin: 0 -14px;
}
#bottombar {
.center {

View File

@ -74,15 +74,10 @@ modulejs.define('core/location', ['_', 'modernizr', 'core/settings', 'core/event
setLocation = function (newAbsHref, keepBrowserUrl) {
newAbsHref = encodedHref(newAbsHref);
if (absHref !== newAbsHref) {
absHref = newAbsHref;
notify.set('loading...');
modulejs.require('core/refresh')(function () {
notify.set();
event.pub('location.changed', getItem());
});
if (history) {
if (keepBrowserUrl) {
history.replaceState({absHref: absHref}, '', absHref);
@ -91,6 +86,12 @@ modulejs.define('core/location', ['_', 'modernizr', 'core/settings', 'core/event
}
}
}
notify.set('loading...');
modulejs.require('core/refresh')(function () {
notify.set();
event.pub('location.changed', getItem());
});
},
setLink = function ($el, item) {

View File

@ -16,6 +16,15 @@ modulejs.define('view/viewmode', ['_', '$', 'core/settings', 'core/resource', 'c
'</a>' +
'</li>',
adjustSpacing = function () {
var contentWidth = $('#content').width(),
$extended = $('#extended'),
itemWidth = ($extended.hasClass('view-icons') || $extended.hasClass('view-grid')) ? ($extended.find('.entry').eq(0).width() || 1) : 1;
$extended.width(Math.floor(contentWidth / itemWidth) * itemWidth);
},
update = function (viewmode) {
var $extended = $('#extended');
@ -32,6 +41,8 @@ modulejs.define('view/viewmode', ['_', '$', 'core/settings', 'core/resource', 'c
$extended.removeClass('view-' + mode);
}
});
adjustSpacing();
},
init = function () {
@ -54,6 +65,8 @@ modulejs.define('view/viewmode', ['_', '$', 'core/settings', 'core/resource', 'c
}
update(store.get(storekey));
$(window).on('resize', adjustSpacing);
};
init();