Skip to content

Commit

Permalink
Merge pull request #11403 from uberbrady/remember_disclosure_triangles
Browse files Browse the repository at this point in the history
Remember the state of the disclosure triangles in Assets
  • Loading branch information
snipe authored Jun 27, 2022
2 parents 8f900fb + 34b4499 commit 518395b
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion resources/views/hardware/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -333,17 +333,37 @@ function user_add(status_id) {
});
{{-- TODO: Clean up some of the duplication in here. Not too high of a priority since we only copied it once. --}}
$("#optional_info").on("click",function(){
$('#optional_details').fadeToggle(100);
$('#optional_info_icon').toggleClass('fa-caret-right fa-caret-down');
var optional_info_open = $('#optional_info_icon').hasClass('fa-caret-down');
document.cookie = "optional_info_open="+optional_info_open+'; path=/';
});
$("#order_info").on("click",function(){
$('#order_details').fadeToggle(100);
$("#order_info_icon").toggleClass('fa-caret-right fa-caret-down');
var order_info_open = $('#order_info_icon').hasClass('fa-caret-down');
document.cookie = "order_info_open="+order_info_open+'; path=/';
});
var all_cookies = document.cookie.split(';')
for(var i in all_cookies) {
var trimmed_cookie = all_cookies[i].trim(' ')
if (trimmed_cookie.startsWith('optional_info_open=')) {
elems = all_cookies[i].split('=', 2)
if (elems[1] == 'true') {
$('#optional_info').trigger('click')
}
}
if (trimmed_cookie.startsWith('order_info_open=')) {
elems = all_cookies[i].split('=', 2)
if (elems[1] == 'true') {
$('#order_info').trigger('click')
}
}
}
});
Expand Down

0 comments on commit 518395b

Please sign in to comment.