some tweaking...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2017-01-21 18:26:56 +03:00
parent cb1870da7c
commit e0dbd413dc

View File

@ -282,7 +282,6 @@ function(text, options){
// ] // ]
// //
// or: // or:
//
// { // {
// <item-lext>: <function>, // <item-lext>: <function>,
// } // }
@ -290,8 +289,13 @@ function(text, options){
// //
// options format: // options format:
// { // {
// // pattern used to match and disable items...
// //
// // NOTE: this is used via .replace(..) so the match will get
// // removed from the item text, unless prevented via regexp.
// disableItemPattern: <pattern>, // disableItemPattern: <pattern>,
// //
// // if true, disabled items will not get created...
// skipDisabledItems: false, // skipDisabledItems: false,
// //
// ... // ...
@ -312,10 +316,10 @@ function(data, options){
if(pattern){ if(pattern){
txt = k instanceof Array ? k[0] : k txt = k instanceof Array ? k[0] : k
// item matches disabled pattern...
if(pattern.test(txt)){
var t = txt.replace(pattern, '') var t = txt.replace(pattern, '')
// item matches disabled pattern...
if(t != txt){
opts.disabled = true opts.disabled = true
txt = k instanceof Array ? txt = k instanceof Array ?
@ -3061,7 +3065,7 @@ module.makeLister = function(elem, lister, options){
// Flat list... // Flat list...
// //
// This expects a data option set with the following formats: // This expects a data option set with one of the following formats:
// { // {
// <option-text>: <callback>, // <option-text>: <callback>,
// ... // ...
@ -3078,6 +3082,7 @@ module.makeLister = function(elem, lister, options){
// disable this feature set it to false|null. // disable this feature set it to false|null.
// //
// NOTE: this essentially a different default configuration of Browser... // NOTE: this essentially a different default configuration of Browser...
// NOTE: this is essentially a wrapper around make.List(...)
var ListPrototype = Object.create(Browser.prototype) var ListPrototype = Object.create(Browser.prototype)
ListPrototype.options = { ListPrototype.options = {
@ -3104,7 +3109,9 @@ ListPrototype.options = {
} }
_make.__proto__ = make _make.__proto__ = make
_make.List(data, { // build the list...
_make
.List(data, {
disableItemPattern: this.options.disableItemPattern, disableItemPattern: this.options.disableItemPattern,
skipDisabledItems: this.options.skipDisabledItems, skipDisabledItems: this.options.skipDisabledItems,
}) })
@ -3112,10 +3119,6 @@ ListPrototype.options = {
return res return res
}, },
} }
// XXX should we inherit or copy options???
// ...inheriting might pose problems with deleting values reverting
// them to default instead of nulling them and mutable options might
// get overwritten...
ListPrototype.options.__proto__ = Browser.prototype.options ListPrototype.options.__proto__ = Browser.prototype.options
var List = var List =
@ -3355,10 +3358,6 @@ PathListPrototype.options = {
} }
}, },
} }
// XXX should we inherit or copy options???
// ...inheriting might pose problems with deleting values reverting
// them to default instead of nulling them and mutable options might
// get overwritten...
PathListPrototype.options.__proto__ = Browser.prototype.options PathListPrototype.options.__proto__ = Browser.prototype.options
var PathList = var PathList =