Bläddra i källkod

Add submit button to adv-search form.

Add:
        templates/index.html, static/(js/index.advanced-search-form.js,
        sass/index.sass)
                -Add a "submit" button to the advanced search form, with styling
                and appropriate callbacks.
tags/v1.0^2
Severyn Kozak 10 år sedan
förälder
incheckning
7debb99461
4 ändrade filer med 22 tillägg och 1 borttagningar
  1. +9
    -0
      static/js/index.advanced-search-form.js
  2. +2
    -0
      static/js/index.js
  3. +8
    -1
      static/sass/index.sass
  4. +3
    -0
      templates/index.html

+ 9
- 0
static/js/index.advanced-search-form.js Visa fil

@@ -92,6 +92,13 @@ loadInputFieldWidgets();
searchGroups[0].scrollTop = searchGroups[0].scrollHeight;
});

$("div#advanced-search button#submit").click(function(){
$("div#advanced-search").hide();
advancedSearchButton.removeClass("clicked");
assembleQuery();
queryServer();
})

var previousAdvancedQuery = "";
var searchBar = $("form#search-bar input[name=query]");

@@ -158,6 +165,8 @@ function assembleQuery(){
*
* @param field (DOM element) An `input[type=text]` element.
* @param hasRegex (boolean) Whether or not the field's value has regex.
*
* @return The processed query.
*/
function genFieldQueryString(field, hasRegex){
var terms = field.value.replace(/\\/g, "\\\\").replace(/\"/g, "\\\"");


+ 2
- 0
static/js/index.js Visa fil

@@ -47,6 +47,7 @@ var searchResultsPage = 1;
advancedSearchButton.removeClass("clicked");
if($("div#results .result").length == 0)
searchField.removeClass("partly-visible");
clearResults();
}
});

@@ -197,6 +198,7 @@ function finishedTyping(){
searchField.removeClass("partly-visible");
$("div#advanced-search").fadeOut(50);
advancedSearchButton.removeClass("clicked");
clearResults();
}
}



+ 8
- 1
static/sass/index.sass Visa fil

@@ -205,6 +205,7 @@ div#advanced-search
float: right
font-size: 80%
font-weight: bold
margin-right: 1%
padding-left: 4%
padding-right: 4%

@@ -213,7 +214,6 @@ div#advanced-search

&#add-group
background-color: #7FAFFC
margin-right: 1%

&:hover
background-color: #609AF8
@@ -224,6 +224,12 @@ div#advanced-search
&:hover
background-color: #D63636

&#submit
background-color: #4ee76c

&:hover
background-color: #0FDD38

>div
@include vendor(box-sizing, border-box)

@@ -316,6 +322,7 @@ div#advanced-search

&:hover
cursor: pointer
background-color: #d6d6d6

&#selected
background-color: #CACACA


+ 3
- 0
templates/index.html Visa fil

@@ -39,6 +39,9 @@
<div id="col1">Fields</div
><div id="col2">
Search groups
<button id="submit">
<div>Search</div>
</button>
<button id="add-group">
<div><span>+</span> Add</div>
</button>


Laddar…
Avbryt
Spara