Skip to content
Browse files

prevents a possible double-add of line items from admin/orders/new. r…

…emoves spree's click handler before providing a replacement for adding a new line item
  • Loading branch information...
1 parent d51146d commit 1bdad87b9f0ba0661d822bc607ba7bc1caadc5e1 @jsqu99 committed
View
2 app/assets/javascripts/admin/orders/edit.js
@@ -1,6 +1,8 @@
// overrides spree core's version to include our variant configurations
$(document).ready(function(){
+ $("#add_line_item_to_order").off("click"); // remove spree's version
+
$("#add_line_item_to_order").on("click", function(){
if($('#add_variant_id').val() == ''){ return false; }
update_target = $(this).attr("data-update");
View
4 app/assets/javascripts/admin/spree_flexi_variants.js
@@ -0,0 +1,4 @@
+//= require admin/spree_core
+//= require jquery.formatCurrency-1.4.0.min
+//= require i18n/jquery.formatCurrency.all
+//= require_tree
View
7 lib/generators/spree_flexi_variants/install/install_generator.rb
@@ -2,9 +2,10 @@ module SpreeFlexiVariants
module Generators
class InstallGenerator < Rails::Generators::Base
- # def add_javascripts
- # append_file "app/assets/javascripts/store/all.js", "//= require store/spree_flexi_variants\\n"
- # end
+ def add_javascripts
+ append_file "app/assets/javascripts/store/all.js", "//= require store/spree_flexi_variants\n"
+ append_file "app/assets/javascripts/admin/all.js", "//= require admin/spree_flexi_variants\n"
+ end
# def add_stylesheets
# inject_into_file "app/assets/stylesheets/store/all.css", " *= require store/spree-flexi-variants\\n", :before => /\\*\\//, :verbose => true

0 comments on commit 1bdad87

Please sign in to comment.
Something went wrong with that request. Please try again.