Added proxy support
diff --git a/public/js/src/menu.js b/public/js/src/menu.js
index 5e7537b..3d0017d 100644
--- a/public/js/src/menu.js
+++ b/public/js/src/menu.js
@@ -10,9 +10,12 @@
"use strict";
// Don't let events bubble up
- Event.prototype.halt = function () {
- this.stopPropagation();
- this.preventDefault();
+ if (Event.halt === undefined) {
+ // Don't let events bubble up
+ Event.prototype.halt = function () {
+ this.stopPropagation();
+ this.preventDefault();
+ };
};
// Default maximum number of menu items
diff --git a/public/js/src/vc.js b/public/js/src/vc.js
index 00528aa..fa63457 100644
--- a/public/js/src/vc.js
+++ b/public/js/src/vc.js
@@ -1329,17 +1329,19 @@
*/
KorAP._changeKey = function () {
var doc = this.parentNode.refTo;
- console.log(doc.type());
+ var key = doc.element().firstChild;
+ key.appendChild(KorAP.FieldChooser.element());
+ KorAP.FieldChooser.show();
+ KorAP.FieldChooser.focus();
// key, matchop, type, value
};
-
// Field menu
KorAP.FieldMenu = {
create : function (params) {
return Object.create(KorAP.Menu)
.upgradeTo(KorAP.FieldMenu)
- ._init(KorAP.FieldMenuItem, params)
+ ._init(KorAP.FieldMenuItem, undefined, params)
}
};
@@ -1382,5 +1384,13 @@
return this._element = li;
}
};
+
+ KorAP.FieldChooser = KorAP.FieldMenu.create([
+ ['Titel', 'title', 'string'],
+ ['Untertitel', 'subTitle', 'string'],
+ ['Veröffentlichungsdatum', 'pubDate', 'date'],
+ ['Autor', 'author', 'string']
+ ]);
+ KorAP.FieldChooser.limit(5);
}(this.KorAP));