浏览代码

[beeswax] Smarted magic table autocomplete

Enrico Berti 12 年之前
父节点
当前提交
be06349f1b
共有 2 个文件被更改,包括 10 次插入2 次删除
  1. 5 1
      desktop/core/static/js/codemirror-hql-hint.js
  2. 5 1
      desktop/core/static/js/codemirror-isql-hint.js

+ 5 - 1
desktop/core/static/js/codemirror-hql-hint.js

@@ -95,7 +95,11 @@
     }
 
     function maybeAddToExtra(str) {
-      if (str.indexOf(start) == 0 && !arrayContains(found, str)) extraFound.push(str);
+      var _match = str;
+      if (_match.indexOf("icon-magic") > -1) {
+        _match = _match.substring(32);
+      }
+      if (_match.indexOf(start) == 0 && !arrayContains(found, str)) extraFound.push(str);
     }
 
     function gatherCompletions(obj) {

+ 5 - 1
desktop/core/static/js/codemirror-isql-hint.js

@@ -95,7 +95,11 @@
     }
 
     function maybeAddToExtra(str) {
-      if (str.indexOf(start) == 0 && !arrayContains(found, str)) extraFound.push(str);
+      var _match = str;
+      if (_match.indexOf("icon-magic") > -1) {
+        _match = _match.substring(32);
+      }
+      if (_match.indexOf(start) == 0 && !arrayContains(found, str)) extraFound.push(str);
     }
 
     function gatherCompletions(obj) {