minor refactoring...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2015-05-17 03:52:21 +03:00
parent 9fe814120e
commit 5a8f676fbe

View File

@ -196,12 +196,22 @@ var BrowserPrototype = {
// Select a list element...
//
// Get selected element if it exists, otherwise select and return
// the first...
// .select()
// -> elem
//
// Get selected element if it exists, null otherwise...
// .select('!')
// -> elem
// -> $()
//
// Select first/last child
// .select('first')
// .select('last')
// -> elem
//
// Select previous/lext child
// Select previous/next child
// .select('prev')
// .select('next')
// -> elem
@ -210,11 +220,6 @@ var BrowserPrototype = {
// .select('none')
// -> elem
//
// Get selected element if it exists, null otherwise...
// .select('!')
// -> elem
// -> $()
//
// Select element by sequence number
// .select(<number>)
// -> elem
@ -288,6 +293,24 @@ var BrowserPrototype = {
}
},
// Select next element...
next: function(elem){
if(elem != null){
this.select(elem)
}
this.select('next')
return this
},
// Select previous element...
prev: function(elem){
if(elem != null){
this.select(elem)
}
this.select('prev')
return this
},
// Push an element to path / go down one level...
push: function(elem){
var browser = this.dom
var elem = this.select(elem || '!')
@ -314,7 +337,7 @@ var BrowserPrototype = {
return this
},
// pop an element off the path / go up one level...
// Pop an element off the path / go up one level...
pop: function(){
var browser = this.dom
var path = this.path
@ -326,20 +349,6 @@ var BrowserPrototype = {
return this
},
next: function(elem){
if(elem != null){
this.select(elem)
}
this.select('next')
return this
},
prev: function(elem){
if(elem != null){
this.select(elem)
}
this.select('prev')
return this
},
focus: function(){
this.dom.focus()