Skip to content

Commit

Permalink
Toggle existing tag to disable hashtag navigation
Browse files Browse the repository at this point in the history
Fixes #48
  • Loading branch information
aaronjudd committed Apr 25, 2014
1 parent cf33bb1 commit 586476d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ Template.productDetailTags.helpers
currentHashTag: () ->
if currentProduct.get("product").handle is @.name
return true

Template.productTagInputForm.helpers
hashtagMark: () ->
if currentProduct.get("product").handle is @.name
Expand All @@ -11,8 +12,12 @@ Template.productTagInputForm.helpers

Template.productTagInputForm.events
'click .tag-input-hashtag': (event,template) ->
Products.update(currentProduct.get("product")._id, {$set:{"handle":@.name}})
Router.go "product", "_id": @.name
if currentProduct.get("product").handle is @.name
Products.update(currentProduct.get("product")._id, {$unset:{"handle":""}},{validate: false})
Router.go "product", "_id": currentProduct.get("product")._id
else
Products.update(currentProduct.get("product")._id, {$set:{"handle":@.name}})
Router.go "product", "_id": @.name

'click .tag-input-group-remove': (event,template) ->
Meteor.call "removeProductTag",currentProduct.get("product")._id, @._id
Expand Down
1 change: 1 addition & 0 deletions packages/reaction-commerce/common/collections.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@ SocialSchema = new SimpleSchema
optional: true
handle:
type: String
optional: true
index: 1
isVisible:
type: Boolean
Expand Down

0 comments on commit 586476d

Please sign in to comment.