svn: /web/doc-editor/trunk/js/ui/component/ EntitiesAcronymsPanel.js
[email protected] (Yannick Torres)
| Newsgroups | php.doc.web |
|---|---|
| Message-ID | <[email protected]> |
yannick Thu, 08 Apr 2010 18:59:42 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=297710
Log:
Filter on 'from', 'items', 'value' ; Suggested by Yago
Changed paths:
U web/doc-editor/trunk/js/ui/component/EntitiesAcronymsPanel.js
Modified: web/doc-editor/trunk/js/ui/component/EntitiesAcronymsPanel.js
===================================================================
--- web/doc-editor/trunk/js/ui/component/EntitiesAcronymsPanel.js 2010-04-08 17:17:09 UTC (rev 297709)
+++ web/doc-editor/trunk/js/ui/component/EntitiesAcronymsPanel.js 2010-04-08 18:59:42 UTC (rev 297710)
@@ -126,7 +126,7 @@
},
onTrigger2Click: function()
{
- var v = this.getValue();
+ var v = this.getValue(), regexp;
if (v === '' || v.length < 3) {
this.markInvalid(
@@ -137,7 +137,21 @@
this.clearInvalid();
this.triggers[0].show();
this.setSize(180,10);
- this.ownerCt.ownerCt.store.filter('entities', v, true);
+
+ regexp = new RegExp(v, 'i');
+
+ // We filter on 'from', 'items', 'value'
+ this.ownerCt.ownerCt.store.filterBy(function(record) {
+
+ if( regexp.test(record.data.from) ||
+ regexp.test(record.data.items) ||
+ regexp.test(record.data.value)
+ ) {
+ return true;
+ } else {
+ return false;
+ }
+ }, this);
}
})
]