diff --git a/js/templates/instance/filter-users.html b/js/templates/instance/filter-users.html index cf3007d..103875b 100644 --- a/js/templates/instance/filter-users.html +++ b/js/templates/instance/filter-users.html @@ -5,18 +5,19 @@
- + - +
-
diff --git a/views/instance.php b/views/instance.php index 5c4247e..44e535c 100644 --- a/views/instance.php +++ b/views/instance.php @@ -62,9 +62,26 @@ window.view.instance = { filter_users: function() { E.http_template('instance/filter-users', function(html) { E.element('#window-instance #container').innerHTML = html; + E.elemid('profile-search-type-simple').onchange = function(e) { + if (e.target.checked) { + E.element('textarea[name="profile"]').setAttribute('placeholder', 'Input your text here'); + E.element('textarea[name="profile"]').removeAttribute('disabled'); + } + }; + E.elemid('profile-search-type-expr').onchange = function(e) { + if (e.target.checked) { + E.element('textarea[name="profile"]').setAttribute('placeholder', '(words "apple banana" AND contains "i like apples") OR words "pineapple strawberry"'); + E.element('textarea[name="profile"]').removeAttribute('disabled'); + } + }; + E.elemid('profile-search-type-empty').onchange = function(e) { + if (e.target.checked) { + E.element('textarea[name="profile"]').setAttribute('placeholder', ''); + E.element('textarea[name="profile"]').setAttribute('disabled', 'disabled'); + } + } E.custom.btncollapse_render(); }); - console.log('aaa'); }, }, load_content: function(content, hashload) {