Skip to content
This repository was archived by the owner on Mar 7, 2018. It is now read-only.

Correctly removes old status classes on the number widget when updating the status#48

Merged
pushmatrix merged 3 commits intoShopify:masterfrom
davefp:status_fix
Feb 14, 2013
Merged

Correctly removes old status classes on the number widget when updating the status#48
pushmatrix merged 3 commits intoShopify:masterfrom
davefp:status_fix

Conversation

@davefp
Copy link
Copy Markdown
Contributor

@davefp davefp commented Dec 12, 2012

Fixes #45

@crcastle
Copy link
Copy Markdown

Would this be a better way to update the status- class? This will handle statuses outside of just "danger" and "warning"

onData: (data) ->
  if data.status
    # clear existing "status-*" classes
      $(@get('node')).attr 'class', (i,c) ->
        c.replace /\bstatus-\S+/g, ''
      # add new class
      $(@get('node')).addClass "status-#{data.status}"

@pushmatrix
Copy link
Copy Markdown
Member

Yeah, I like the flexibility of @crcastle's approach. @davefp, can you incorporate that into your PR?

@davefp
Copy link
Copy Markdown
Contributor Author

davefp commented Dec 29, 2012

@pushmatrix Updated with @crcastle's suggestions.

@kevinthompson
Copy link
Copy Markdown
Contributor

👍

pushmatrix added a commit that referenced this pull request Feb 14, 2013
Correctly removes old status classes on the number widget when updating the status
@pushmatrix pushmatrix merged commit 67125b8 into Shopify:master Feb 14, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update status issue with Number widget

4 participants