docs + cleanup...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2017-02-08 07:08:36 +03:00
parent cb839de7ef
commit ed9ed63e21

View File

@ -2465,16 +2465,30 @@ var BrowserPrototype = {
//------------------------------------------------------------- //-------------------------------------------------------------
}, },
// Update item shortcut key number hints...
//
// Update hints...
// .updateItemNumbers()
// -> this
//
// Clear hints...
// .updateItemNumbers(true)
// -> this
//
// This should be called every time the list is modified manually,
// the automatic side of things is taken care of by .update(..)...
//
// XXX hackish -- move this back to CSS as soon as :nth-match(..) gets // XXX hackish -- move this back to CSS as soon as :nth-match(..) gets
// enough support... // enough support...
updateItemNumbers: function(){ updateItemNumbers: function(clear){
this.dom this.dom
.find('[shortcut-number]') .find('[shortcut-number]')
.removeAttr('shortcut-number') .removeAttr('shortcut-number')
this.filter('*') !clear
.slice(0, 10) && this.filter('*')
.each(function(i){ .slice(0, 10)
$(this).attr('shortcut-number', (i+1)%10) }) .each(function(i){
$(this).attr('shortcut-number', (i+1)%10) })
return this return this
}, },