Fixed RE for stringhelper (but blur is not perfect yet)
diff --git a/dev/js/src/vc/stringval.js b/dev/js/src/vc/stringval.js
index f9aa593..cce278a 100644
--- a/dev/js/src/vc/stringval.js
+++ b/dev/js/src/vc/stringval.js
@@ -119,10 +119,25 @@
if (this.value() !== undefined)
this._input.value = this.value();
- this._input.addEventListener(
+ // Add regex button
+ var re = e.appendChild(
+ document.createElement('div')
+ );
+ re.addEventListener(
+ 'click',
+ function (e) {
+ this.toggleRegex();
+ e.halt();
+ }.bind(this),
+ true
+ );
+ re.appendChild(document.createTextNode('RE'));
+
+ e.addEventListener(
'blur',
- function () {
+ function (e) {
this.store(this.value(), this.regex());
+ e.halt();
}.bind(this)
);
@@ -137,16 +152,6 @@
}.bind(this)
);
- // Add regex button
- var re = e.appendChild(
- document.createElement('div')
- );
- re.addEventListener('click', function (e) {
- this.toggleRegex();
- e.halt();
- }.bind(this));
- re.appendChild(document.createTextNode('RE'));
-
// Add store button
/*
e.appendChild(
diff --git a/dev/scss/header/vc.scss b/dev/scss/header/vc.scss
index 1f73cef..559a982 100644
--- a/dev/scss/header/vc.scss
+++ b/dev/scss/header/vc.scss
@@ -102,12 +102,19 @@
.doc {
padding-left: $left-padding;
> span + span,
- > span + .menu + span{
+ > span + div + span {
margin-left: 5pt;
}
+
> span.key,
> span.value {
font-weight: bold;
+ &[data-type=regex] {
+ font-style: italic;
+ &::after, &::before {
+ content: '/';
+ }
+ }
}
/**
@@ -243,6 +250,10 @@
}
}
&.regex {
+ > input {
+ font-style: italic;
+ }
+
> div {
@include choose-active;
}