mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-11-01 20:00:10 +00:00
minor refactoring and doc revision...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
2da348a0db
commit
1b56fb6a24
@ -173,7 +173,7 @@ var BrowserPrototype = {
|
|||||||
//
|
//
|
||||||
// XXX is this the correct name???
|
// XXX is this the correct name???
|
||||||
path2lst: function(path){
|
path2lst: function(path){
|
||||||
var splitter = /[\\\/]+/
|
var splitter = /[\\\/]/
|
||||||
|
|
||||||
if(typeof(path) == typeof('str')){
|
if(typeof(path) == typeof('str')){
|
||||||
path = path
|
path = path
|
||||||
@ -208,7 +208,7 @@ var BrowserPrototype = {
|
|||||||
|
|
||||||
// Trigger jQuery events on Browser...
|
// Trigger jQuery events on Browser...
|
||||||
//
|
//
|
||||||
// This will pass the browser instance to .source attribute of the
|
// This will pass the Browser instance to .source attribute of the
|
||||||
// event object triggered.
|
// event object triggered.
|
||||||
trigger: function(){
|
trigger: function(){
|
||||||
var args = args2array(arguments)
|
var args = args2array(arguments)
|
||||||
@ -243,6 +243,8 @@ var BrowserPrototype = {
|
|||||||
blur: proxyToDom('blur'),
|
blur: proxyToDom('blur'),
|
||||||
|
|
||||||
|
|
||||||
|
// base api...
|
||||||
|
|
||||||
// XXX should these set both the options and dom???
|
// XXX should these set both the options and dom???
|
||||||
get flat(){
|
get flat(){
|
||||||
return !this.dom.hasClass('flat') || this.options.flat
|
return !this.dom.hasClass('flat') || this.options.flat
|
||||||
@ -269,7 +271,13 @@ var BrowserPrototype = {
|
|||||||
this.options.traversable = value
|
this.options.traversable = value
|
||||||
},
|
},
|
||||||
|
|
||||||
// base api...
|
// Get/set the path...
|
||||||
|
//
|
||||||
|
// On more info on setting the path see .update(..)
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// NOTE: .path = <some-path> is equivalent to .update(<some-path>)
|
||||||
|
// both exist at the same time to enable chaining...
|
||||||
// NOTE: to avoid duplicating and syncing data, the actual path is
|
// NOTE: to avoid duplicating and syncing data, the actual path is
|
||||||
// stored in DOM...
|
// stored in DOM...
|
||||||
// NOTE: path does not include the currently selected list element,
|
// NOTE: path does not include the currently selected list element,
|
||||||
@ -291,9 +299,12 @@ var BrowserPrototype = {
|
|||||||
//
|
//
|
||||||
// For uniformity and ease of access from DOM, this will also set the
|
// For uniformity and ease of access from DOM, this will also set the
|
||||||
// 'path' html attribute on the .browse element.
|
// 'path' html attribute on the .browse element.
|
||||||
// NOTE: this works one way, navigating to a different path will
|
//
|
||||||
// overwrite the attr but setting a new value to the html attr
|
// NOTE: setting the DOM attr 'path' works one way, navigating to a
|
||||||
// will not affect the actual path.
|
// different path will overwrite the attr but setting a new
|
||||||
|
// value to the html attr will not affect the actual path.
|
||||||
|
// NOTE: .path = <some-path> is equivalent to .update(<some-path>)
|
||||||
|
// both exist at the same time to enable chaining...
|
||||||
//
|
//
|
||||||
// XXX need a way to handle path errors in the extension API...
|
// XXX need a way to handle path errors in the extension API...
|
||||||
// ...for example, if .list(..) can't list or lists a different
|
// ...for example, if .list(..) can't list or lists a different
|
||||||
@ -462,7 +473,8 @@ var BrowserPrototype = {
|
|||||||
//
|
//
|
||||||
//
|
//
|
||||||
// TODO need to support glob / nested patterns...
|
// TODO need to support glob / nested patterns...
|
||||||
// ..things like /**/a*/*moo/
|
// ..things like /**/a*/*moo/ should list all matching items in
|
||||||
|
// a single list.
|
||||||
//
|
//
|
||||||
// XXX add * support...
|
// XXX add * support...
|
||||||
filter: function(pattern, a, b){
|
filter: function(pattern, a, b){
|
||||||
@ -644,7 +656,7 @@ var BrowserPrototype = {
|
|||||||
return this
|
return this
|
||||||
},
|
},
|
||||||
|
|
||||||
// Select a list element...
|
// Select an element from current list...
|
||||||
//
|
//
|
||||||
// Get selected element if it exists, otherwise select and return
|
// Get selected element if it exists, otherwise select and return
|
||||||
// the first...
|
// the first...
|
||||||
@ -970,7 +982,7 @@ var BrowserPrototype = {
|
|||||||
return res
|
return res
|
||||||
},
|
},
|
||||||
|
|
||||||
// List the path...
|
// List current path level...
|
||||||
//
|
//
|
||||||
// This will get passed a path and an item constructor and should
|
// This will get passed a path and an item constructor and should
|
||||||
// return a list.
|
// return a list.
|
||||||
@ -1052,6 +1064,9 @@ object.makeConstructor('Browser',
|
|||||||
BrowserPrototype)
|
BrowserPrototype)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*********************************************************************/
|
||||||
|
|
||||||
// Flat list...
|
// Flat list...
|
||||||
//
|
//
|
||||||
// This expects a data option set with the following format:
|
// This expects a data option set with the following format:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user