[PATCH conductor] BZ783923 Prevent redisplaying previous filters by backbone when the view is refreshed
Jirka Tomasek
jtomasek at redhat.com
Fri Feb 10 13:41:42 UTC 2012
On 02/10/2012 01:02 PM, Imre Farkas wrote:
> On 02/09/2012 04:29 PM, jtomasek at redhat.com wrote:
>> From: Jiri Tomasek<jtomasek at redhat.com>
>>
>> ---
>> src/app/views/layouts/_tabpanel.html.haml | 5 +++++
>> src/public/javascripts/application.js | 9 ++++++++-
>> 2 files changed, 13 insertions(+), 1 deletions(-)
>>
>> diff --git a/src/app/views/layouts/_tabpanel.html.haml
>> b/src/app/views/layouts/_tabpanel.html.haml
>> index 277ba1c..2c4050b 100644
>> --- a/src/app/views/layouts/_tabpanel.html.haml
>> +++ b/src/app/views/layouts/_tabpanel.html.haml
>> @@ -12,3 +12,8 @@
>> -#%a.collapse{'href'=>'#'} Collapse
>> .content.collapsible#tab
>> = render :partial => @details_tab[:view]
>> +
>> +:javascript
>> + $("#tab-container-1-nav li a").click(function(){
>> + Conductor.tabIsClickedResetFilters = true;
>> + });
> I think it would be better to place this handler inside of a
> $(document).ready(function() {...}) to make it a bit less error prone.
>
>
>> diff --git a/src/public/javascripts/application.js
>> b/src/public/javascripts/application.js
>> index 6cef5c2..3d76c90 100644
>> --- a/src/public/javascripts/application.js
>> +++ b/src/public/javascripts/application.js
>> @@ -3,6 +3,8 @@
>>
>>
>> $.extend(Conductor, {
>> + tabIsClickedResetFilters: false,
>> +
>> positionFooter: function () {
>> var $footer = $('footer');
>> if ($(document.body).height()< $(window).height()) {
>> @@ -165,7 +167,12 @@ $.extend(Conductor, {
>> },
>>
>> urlParams: function() {
>> - var paramsData = window.location.search.slice(1).split('&');
>> + if(Conductor.tabIsClickedResetFilters == false){
>> + var paramsData = window.location.search.slice(1).split('&');
>> + } else {
>> + var paramsData = [];
>> + }
>> +
>> var params = {};
>> $.each(paramsData, function(index, value){
>> var eqSign = value.search('=');
>
> ACK with one inline note
Fixed and Pushed
More information about the aeolus-devel
mailing list