Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(282)

Unified Diff: appengine/monorail/templates/tracker/field-value-widgets-js.ezt

Issue 1868553004: Open Source Monorail (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Rebase Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: appengine/monorail/templates/tracker/field-value-widgets-js.ezt
diff --git a/appengine/monorail/templates/tracker/field-value-widgets-js.ezt b/appengine/monorail/templates/tracker/field-value-widgets-js.ezt
new file mode 100644
index 0000000000000000000000000000000000000000..fd012a52b3e2814c39e01de26dac79fa732864af
--- /dev/null
+++ b/appengine/monorail/templates/tracker/field-value-widgets-js.ezt
@@ -0,0 +1,35 @@
+<script type="text/javascript" nonce="[nonce]">
+runOnLoad(function() {
+ var removeMFVElements = document.getElementsByClassName("removeMultiFieldValueWidget");
+ for (var i = 0; i < removeMFVElements.length; ++i) {
+ var el = removeMFVElements[[]i];
+ el.addEventListener("click", function(event) {
+ _removeMultiFieldValueWidget(event.target);
+ });
+ }
+
+ var addMFVElements = document.getElementsByClassName("addMultiFieldValueWidget");
+ for (var i = 0; i < addMFVElements.length; ++i) {
+ var el = addMFVElements[[]i];
+ el.addEventListener("click", function(event) {
+ var target = event.target;
+ var fieldID = target.getAttribute("data-field-id");
+ var fieldType = target.getAttribute("data-type");
+ var fieldValidate1 = target.getAttribute("data-validate-1");
+ var fieldValidate2 = target.getAttribute("data-validate-2");
+ _addMultiFieldValueWidget(
+ event.target, fieldID, fieldType, fieldValidate1, fieldValidate2);
+ });
+ }
+
+ var customFieldElements = document.getElementsByClassName("customfield");
+ for (var i = 0; i < customFieldElements.length; ++i) {
+ var el = customFieldElements[[]i];
+ el.addEventListener("focus", function(event) {
+ _acrob(null);
+ _acof(event);
+ });
+ el.addEventListener("keyup", _dirty);
+ }
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698