Commits

Bertrand Le Roy  committed 0fae428

Minor client event changes

  • Participants
  • Parent commits c88a2c0

Comments (0)

Files changed (4)

File Nwazet.Commerce.csproj

       <DependentUpon>referral.js</DependentUpon>
     </Content>
     <Content Include="Scripts\shoppingcart.js">
-      <Generator>GoogleClosureCompiler</Generator>
       <LastGenOutput>shoppingcart.min.js</LastGenOutput>
     </Content>
     <Content Include="Scripts\shoppingcart.min.js">

File Scripts/shoppingcart.js

 jQuery(function ($) {
-    function setQuantityToZero(parentTag) {
-        return function (button) {
+    var setQuantityToZero = function(parentTag) {
+        return function(button) {
             return button.parents(parentTag + ":first")
                 .find("input.quantity").val(0)
                 .parents("form");
         };
-    }
+    },
+        miniLoad = function(form) {
+            mini.load(form.attr("action"), form.serializeArray(), onload);
+            return false;
+        },
+        onload = function(text) {
+            mini.parent().toggle(text.trim().length > 0);
+            $(this).trigger("nwazet.cartupdated");
+        },
+        mini = $(".minicart");
 
+    mini.load(mini.data("url"), onload)
+        .parent().hide();
+    
     $(".shoppingcart .delete").live("click", function () {
         $(this).trigger("nwazet.removefromcart");
         setQuantityToZero("tr")($(this)).submit();
     });
 
-    var mini = $(".minicart");
-    mini.load(mini.data("url"), onload).parent().hide();
-
-    function miniLoad(form) {
-        mini.load(form.attr("action"), form.serializeArray(), onload);
-        return false;
-    }
-
-    function onload(text) {
-        $(this).trigger("nwazet.cartupdated");
-        mini.parent().toggle(text.trim().length > 0);
-    }
 
     $(".minicart .delete").live("click", function () {
         $(this).trigger("nwazet.removefromcart");

File Scripts/shoppingcart.min.js

-jQuery(function(n){function i(n){return function(t){return t.parents(n+":first").find("input.quantity").val(0).parents("form")}}function r(n){return t.load(n.attr("action"),n.serializeArray(),u),!1}function u(i){n(this).trigger("nwazet.cartupdated"),t.parent().toggle(i.trim().length>0)}n(".shoppingcart .delete").live("click",function(){n(this).trigger("nwazet.removefromcart"),i("tr")(n(this)).submit()});var t=n(".minicart");t.load(t.data("url"),u).parent().hide(),n(".minicart .delete").live("click",function(){return n(this).trigger("nwazet.removefromcart"),r(i("li")(n(this)))}),n(".minicart .update-button, .addtocart-button").live("click",function(){return n(this).trigger("nwazet.addtocart"),r(n(this).parents("form"))})})
+jQuery(function(n){var i=function(n){return function(t){return t.parents(n+":first").find("input.quantity").val(0).parents("form")}},r=function(n){return t.load(n.attr("action"),n.serializeArray(),u),!1},u=function(i){t.parent().toggle(i.trim().length>0),n(this).trigger("nwazet.cartupdated")},t=n(".minicart");t.load(t.data("url"),u).parent().hide(),n(".shoppingcart .delete").live("click",function(){n(this).trigger("nwazet.removefromcart"),i("tr")(n(this)).submit()}),n(".minicart .delete").live("click",function(){return n(this).trigger("nwazet.removefromcart"),r(i("li")(n(this)))}),n(".minicart .update-button, .addtocart-button").live("click",function(){return n(this).trigger("nwazet.addtocart"),r(n(this).parents("form"))})});
 //@ sourceMappingURL=shoppingcart.min.js.map

File Scripts/shoppingcart.min.js.map

 "version":3,
 "file":"shoppingcart.min.js",
 "lineCount":1,
-"mappings":"AAAAA,MAAM,CAAC,QAAS,CAACC,CAAD,CAAI,CAChBC,SAASA,CAAiB,CAACC,CAAD,CAAY,CAClC,OAAO,QAAS,CAACC,CAAD,CAAS,CACrB,OAAOA,CAAMC,QAAQ,CAACF,CAAU,CAAE,QAAb,CACjBG,KAAK,CAAC,gBAAD,CAAkBC,IAAI,CAAC,CAAD,CAC3BF,QAAQ,CAAC,MAAD,CAHS,CADS,CAgBtCG,SAASA,CAAQ,CAACC,CAAD,CAAO,CAEpB,OADAC,CAAIC,KAAK,CAACF,CAAIG,KAAK,CAAC,QAAD,CAAU,CAAEH,CAAII,eAAe,CAAA,CAAE,CAAEC,CAA7C,CAAoD,CACtD,CAAA,CAFa,CAKxBA,SAASA,CAAM,CAACC,CAAD,CAAO,CAClBd,CAAC,CAAC,IAAD,CAAMe,QAAQ,CAAC,oBAAD,CAAsB,CACrCN,CAAIO,OAAO,CAAA,CAAEC,OAAO,CAACH,CAAII,KAAK,CAAA,CAAEC,OAAQ,CAAE,C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AtB,CAhCrC,CAAd,CAoCJ",
 "sources":["shoppingcart.js"],
-"names":["jQuery","$","setQuantityToZero","parentTag","button","parents","find","val","miniLoad","form","mini","load","attr","serializeArray","onload","text","trigger","parent","toggle","trim","length","live","submit","data","hide"]
+"names":["jQuery","$","setQuantityToZero","parentTag","button","parents","find","val","miniLoad","form","mini","load","attr","serializeArray","onload","text","parent","toggle","trim","length","trigger","data","hide","live","submit"]
 }