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,13 +2465,27 @@ 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
// enough support...
updateItemNumbers: function(){
updateItemNumbers: function(clear){
this.dom
.find('[shortcut-number]')
.removeAttr('shortcut-number')
this.filter('*')
!clear
&& this.filter('*')
.slice(0, 10)
.each(function(i){
$(this).attr('shortcut-number', (i+1)%10) })