Skip to content

Commit 3ba02da

Browse files
committed
hid unnecessary fields
1 parent 238b3eb commit 3ba02da

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

data/quotes.html

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -98,19 +98,21 @@
9898
</div>
9999
<div class="row own">
100100
<div>Результат возвращается в:</div>
101-
<select name="type">
101+
<select name="type" onchange="show_fields_block()">
102102
<option value="0">Text</option>
103103
<option value="1">JSON</option>
104104
<option value="2">XML</option>
105105
</select>
106106
</div>
107-
<div class="one own">
108-
<div>Название поля с цитатой:</div>
109-
<input class="long" type="text" name="quote_field" placeholder="quote">
110-
</div>
111-
<div class="one own">
112-
<div>Название поля с автором <span class="small">(или пусто, если не надо)</span>:</span></div>
113-
<input class="long" type="text" name="author_field" placeholder="quoteAuthor">
107+
<div class="fields">
108+
<div class="one own">
109+
<div>Название поля с цитатой:</div>
110+
<input class="long" type="text" name="quote_field" placeholder="quote">
111+
</div>
112+
<div class="one own">
113+
<div>Название поля с автором <span class="small">(или пусто, если не надо)</span>:</span></div>
114+
<input class="long" type="text" name="author_field" placeholder="quoteAuthor">
115+
</div>
114116
</div>
115117
</div>
116118
<button>Сохранить</button>
@@ -138,6 +140,12 @@
138140
toggle_by_class("own",false);
139141
}
140142
}
143+
function show_fields_block() {
144+
if(document.forms["settings"].elements["type"].value == 0)
145+
toggle_by_class("fields",false);
146+
else
147+
toggle_by_class("fields",true);
148+
}
141149
function start() {
142150
if (typeof ajaxRequest !== "undefined") {
143151
ajaxRequest("show_quote", "GET", null, function(ajaxResp) {
@@ -147,6 +155,7 @@
147155
show_all_block();
148156
init_color_demo();
149157
show_color_block();
158+
show_fields_block();
150159
$g("shadow").style.display = "none";
151160
});
152161
}, dummy);

0 commit comments

Comments
 (0)