diff options
author | Maxence Lange <maxence@artificial-owl.com> | 2018-05-11 14:08:50 +0300 |
---|---|---|
committer | Maxence Lange <maxence@artificial-owl.com> | 2018-05-11 14:08:50 +0300 |
commit | d021c9a96cbb6789a1482abda0ed9175830da093 (patch) | |
tree | c9c74f0376e1a64c43b2d8b89d2677e84042e9f9 | |
parent | 859b84f95c888af2f9d0e4d018a2963429c7d7ca (diff) |
closing search result
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
-rw-r--r-- | css/fulltextsearch.css | 8 | ||||
-rw-r--r-- | js/fulltextsearch.v1.navigation.js | 16 |
2 files changed, 22 insertions, 2 deletions
diff --git a/css/fulltextsearch.css b/css/fulltextsearch.css index 70564ff..0900a1d 100644 --- a/css/fulltextsearch.css +++ b/css/fulltextsearch.css @@ -66,7 +66,11 @@ input.options_small { bottom: 0; } -.provider_navigation_prev, .provider_navigation_curr, .provider_navigation_next { +.provider_navigation_close { + margin-left: 20px; +} + +.provider_navigation_prev, .provider_navigation_curr, .provider_navigation_next, .provider_navigation_close { float: left; } @@ -77,7 +81,7 @@ input.options_small { margin: -3px 0 0 11px; } -.provider_navigation_prev, .provider_navigation_next { +.provider_navigation_prev, .provider_navigation_next, .provider_navigation_close { cursor: pointer; } diff --git a/js/fulltextsearch.v1.navigation.js b/js/fulltextsearch.v1.navigation.js index d81c032..d03e047 100644 --- a/js/fulltextsearch.v1.navigation.js +++ b/js/fulltextsearch.v1.navigation.js @@ -274,6 +274,12 @@ var nav = { } }, + onResultClose: function () { + if (settings.parentHasMethod('onResultClose')) { + settings.parent.onResultClose(); + } + }, + onError: function (data) { if (settings.parentHasMethod('onError')) { settings.parent.onError(data); @@ -359,6 +365,16 @@ var nav = { }); divProviderPagination.append(divProviderPaginationNext); + if (settings.searchProviderId !== '') { + var divProviderPaginationClose = $('<div>', + {class: 'icon-close provider_navigation_close'}); + divProviderPaginationClose.on('click', function () { + nav.onResultClose(); + }); + divProviderPagination.append(divProviderPaginationClose); + } + + divProviderNavigation.append(divProviderPagination); var divProviderResult = $('<div>', {class: 'provider_result'}); |