我正在尝试将Coffeescript与ember app kit一起使用,但是当我将router.js重命名为router.coffee时,它正在爆炸.我假设它必须使用emc6模块语法.我该如何正确转换它?
Router = Ember.Router.extend()
Router.map ->
@route "component-test"
@route "helper-test"
export default Router
Run Code Online (Sandbox Code Playgroud) My specs will pass in master branch. If I create a new branch and modify some code completely unrelated to the subscriptions, they'll fail with this. The only way I can get them to pass is to change my vcr.rb to have :record => :new_episodes.
If I leave that option on, then almost every time my specs run I have new modified data files for cassettes that end up being committed which really dilute the logs for Git.
Any …
假设我们有衬衫产品。
变体是款式/尺寸。
男士:L
男士:XXL
男士:XL
女士:小号
女式:XL
女:L
现在,在默认的 Shopify 中,无论您选择什么款式,您仍然可以选择任何尺寸,即使该尺寸不适用于该款式。如何根据您的风格选择强制进行此检查?
我相信主题正在使用此技术的修改版本:http://wiki.shopify.com/Tutorial_on_editing_existing_theme_to_use_products_with_multiple_options#4._Instantiate_Shopify.OptionSelectors_javascript
如何修改它以隐藏选项,而不仅仅是在不匹配时显示已售完?
主题的真实代码:
应用程序.js
selectCallback = function(variant, selector) {
var $product = $('#product-' + selector.product.id);
var $notify_form = $('#notify-form-' + selector.product.id);
if (variant) {
var $thumbs = $('.flex-control-thumbs img', $product);
var optionValue = variant.options[$('form.product_form', $product).data('option-index')];
$.each($thumbs, function(index, value) {
if($(value).attr('alt') == optionValue && !$(value).hasClass('flex-active')) {
$(value).click();
return false;
}
});
}
if (variant && variant.available == true) {
if(variant.price < variant.compare_at_price){
$('.was_price', $product).html(Shopify.formatMoney(variant.compare_at_price, $('form.product_form', $product).data('money-format')))
} else { …Run Code Online (Sandbox Code Playgroud)