mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-25 05:45:15 +00:00
Moving our fix for the broken Spree function into our own JS
This commit is contained in:
@@ -12,3 +12,19 @@ $(document).ready(function() {
|
||||
stepMinute: 15
|
||||
});
|
||||
});
|
||||
|
||||
// Overriding a broken function in Spree. Bug report at
|
||||
// https://github.com/spree/spree/issues/4032
|
||||
show_flash_error = function(message) {
|
||||
error_div = $('.flash.error');
|
||||
if (error_div.length > 0) {
|
||||
error_div.html(message);
|
||||
error_div.show();
|
||||
} else {
|
||||
if ($("#content .toolbar").length > 0) {
|
||||
$("#content .toolbar").before('<div class="flash error">' + message + '</div>');
|
||||
} else {
|
||||
$("#progress").before('<div class="flash error">' + message + '</div>');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
notice_div = $('.flash.notice');
|
||||
<% notice = flash.discard(:notice)
|
||||
if notice %>
|
||||
if (notice_div.length > 0) {
|
||||
notice_div.html("<%= notice %>");
|
||||
notice_div.show();
|
||||
} else {
|
||||
if ($("#content .toolbar").length > 0) {
|
||||
$("#content .toolbar").before('<div class="flash notice"><%= notice %></div>');
|
||||
} else {
|
||||
$("#progress").before('<div class="flash notice"><%= notice %></div>');
|
||||
}
|
||||
} <%
|
||||
end %>
|
||||
|
||||
<%= render :partial => '/spree/admin/shared/update_order_state' if @order %>
|
||||
|
||||
Reference in New Issue
Block a user