diff --git a/ui (gen4)/css/widget/browse.css b/ui (gen4)/css/widget/browse.css index 01befa54..126e8777 100755 --- a/ui (gen4)/css/widget/browse.css +++ b/ui (gen4)/css/widget/browse.css @@ -317,7 +317,13 @@ margin-left: -15px; } -/* XXX these are messed up with groups... */ +/* XXX use :nth-match(..) ass soon as it gets enough support... */ +.browse-widget:not(.no-item-numbers) .list .item:not(.heading):before { + content: attr(shortcut-number); +} + +/* XXX these are messed up with groups, use :nth-match(..) ass soon as it gets enough support... */ +/* .browse-widget:not(.no-item-numbers) .list .item:nth-of-type(1):before { content: "1"; } @@ -348,6 +354,7 @@ .browse-widget:not(.no-item-numbers) .list .item:nth-of-type(10):before { content: "0"; } +*/ .browse-widget .list hr.separator { opacity: 0.3; diff --git a/ui (gen4)/lib/widget/browse.js b/ui (gen4)/lib/widget/browse.js index 246d34d4..86c113d0 100755 --- a/ui (gen4)/lib/widget/browse.js +++ b/ui (gen4)/lib/widget/browse.js @@ -743,11 +743,15 @@ function(list, options){ UP: [options.shift_up_button || '⏶', function(p, e){ move(p, -1) - && e.prev().before(e) }], + && e.prev().before(e) + // XXX hackish... + && dialog.updateItemNumbers() }], DOWN: [options.shift_down_button || '⏷', function(p, e){ move(p, 1) - && e.next().after(e) }], + && e.next().after(e) + // XXX hackish... + && dialog.updateItemNumbers() }], TO_TOP: [ (options.to_top_button === true || buttons.indexOf('TO_TOP') >= 0) ? @@ -755,7 +759,10 @@ function(list, options){ : options.to_top_button, function(p, e){ var d = move(p, -dialog.__list[id].length) - d && e.prevAll().eq(Math.abs(d+1)).before(e) + d + && e.prevAll().eq(Math.abs(d+1)).before(e) + // XXX hackish... + && dialog.updateItemNumbers() }], TO_BOTTOM: [ (options.to_bottom_button === true @@ -764,7 +771,10 @@ function(list, options){ : options.to_bottom_button, function(p, e){ var d = move(p, dialog.__list[id].length) - d && e.nextAll().eq(Math.abs(d-1)).after(e) + d + && e.nextAll().eq(Math.abs(d-1)).after(e) + // XXX hackish... + && dialog.updateItemNumbers() }], REMOVE: Buttons.markForRemoval( to_remove, @@ -839,6 +849,7 @@ function(list, options){ .toArray() var l = dialog.__list[id] l.splice.apply(l, [0, l.length].concat(order)) + dialog.updateItemNumbers() }, }) } @@ -2447,10 +2458,26 @@ var BrowserPrototype = { if(focus && browser.find(':focus').length == 0){ that.focus() } + + // XXX hackish... + that.updateItemNumbers() }) //------------------------------------------------------------- }, + // XXX hackish -- move this back to CSS as soon as :nth-match(..) gets + // enough support... + updateItemNumbers: function(){ + this.dom + .find('[shortcut-number]') + .removeAttr('shortcut-number') + this.filter('*') + .slice(0, 10) + .each(function(i){ + $(this).attr('shortcut-number', (i+1)%10) }) + return this + }, + // Filter the item list... // // General signature...