1

More layout changes

This commit is contained in:
Alex Yatskov 2014-11-08 19:16:35 +09:00
parent 121dde6d23
commit 1c496735c7
2 changed files with 20 additions and 14 deletions

View File

@ -14,17 +14,14 @@
</div> </div>
<div class="row"> <div class="row">
<!-- semantic tweaker --> <!-- visualizer -->
<div class="col-md-7"> <div class="col-md-7">
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading"> <div class="panel-heading">
<big>Tweaker</big> <big>Visualizer</big>
</div> </div>
<div class="panel-body"> <div class="panel-body">
<svg id="svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="800" height="500"></svg> <svg id="svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="800" height="500"></svg>
<div class="text-center" style="display: none;">
<input id="history" style="width: 90%;" type="text" data-slider-reversed="true" data-slider-max="0">
</div>
</div> </div>
</div> </div>
</div> </div>
@ -37,7 +34,7 @@
</div> </div>
<div class="panel-body"> <div class="panel-body">
<div class="form-group"> <div class="form-group">
<label for="searchKeyword">Keywords</label> <label for="searchKeyword">Keyword</label>
<select id="searchKeyword" class="form-control"></select> <select id="searchKeyword" class="form-control"></select>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -58,15 +55,21 @@
<div class="checkbox"> <div class="checkbox">
<label><input type="checkbox" id="useRelativeScale" checked="checked">Use relative scale</label> <label><input type="checkbox" id="useRelativeScale" checked="checked">Use relative scale</label>
</div> </div>
<div id="history" class="form-group" style="display: none;">
<label for="history">History</label>
<div class="text-center">
<input id="historyIndex" style="width: 90%;" type="text" data-slider-reversed="true" data-slider-max="0">
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<!-- result listing --> <!-- result listing -->
<div class="panel panel-default"> <div class="panel panel-default" style="display: none;" id="resultPanel">
<div class="panel-heading"> <div class="panel-heading">
<big>Results (<span id="count"></span>)</big> <big>Results (<span id="resultCount"></span>)</big>
</div> </div>
<div class="panel-body"> <div class="panel-body">
<script id="template" type="text/x-handlers-template"> <script id="template" type="text/x-handlers-template">

View File

@ -39,7 +39,7 @@
} }
function onReady() { function onReady() {
$('#history').slider({ $('#historyIndex').slider({
formatter: function(value) { formatter: function(value) {
var delta = _ctx.log.length - (value + 1); var delta = _ctx.log.length - (value + 1);
switch (delta) { switch (delta) {
@ -65,7 +65,7 @@
search(); search();
}); });
$('#history').on('slideStop', onSelectSnapshot); $('#historyIndex').on('slideStop', onSelectSnapshot);
}); });
} }
@ -115,7 +115,7 @@
} }
function onSelectSnapshot() { function onSelectSnapshot() {
var index = $('#history').slider('getValue'); var index = $('#historyIndex').slider('getValue');
outputSnapshot(_ctx.log[index]); outputSnapshot(_ctx.log[index]);
} }
@ -123,12 +123,12 @@
_ctx.log.push(results); _ctx.log.push(results);
var count = _ctx.log.length; var count = _ctx.log.length;
var history = $('#history').slider(); var history = $('#historyIndex').slider();
history.slider('setAttribute', 'max', count - 1); history.slider('setAttribute', 'max', count - 1);
history.slider('setValue', count - 1); history.slider('setValue', count - 1);
if (count > 1) { if (count > 1) {
$('#history').parent().slideDown(); $('#history').slideDown();
} }
} }
@ -145,8 +145,11 @@
var searchResultCnt = String(results.length); var searchResultCnt = String(results.length);
if (results.length < count) { if (results.length < count) {
searchResultCnt += ' of ' + count; searchResultCnt += ' of ' + count;
} }
$('#count').text(searchResultCnt);
$('#resultCount').text(searchResultCnt);
$('#resultPanel').slideDown();
var template = Handlebars.compile($('#template').html()); var template = Handlebars.compile($('#template').html());
$('#results').empty(); $('#results').empty();