Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Rename $.fn.seem to $.fn.mixins

  • Loading branch information...
commit dc105b159cba53c0474d9cf01d2701585947adf8 1 parent b4f9383
@kossnocorp authored
View
12 README.md
@@ -6,15 +6,15 @@ This project uses [Semantic Versioning](http://semver.org/).
## API
-### $.fn.seem
+### $.fn.mixins
-$.fn.seem accepts class as a first argument.
+$.fn.mixins accepts class as a first argument.
## Examples
### Basic usage
-Use `$.fn.seem` to attach stylist functions to a DOM element:
+Use `$.fn.mixins` to attach stylist functions to a DOM element:
``` coffeescript
TrafficLightStylist = class
@@ -22,7 +22,7 @@ TrafficLightStylist = class
makeYellow: -> @css(color: 'yellow')
makeGreen: -> @css(color: 'red')
-$('#traffic_light').seem(TrafficLightStylist)
+$('#traffic_light').mixins(TrafficLightStylist)
$('#traffic_light').makeRed() # Set color to red
$('#traffic_light').makeYellow() # Set color to yellow
@@ -39,7 +39,7 @@ TrafficLightStylist = class
makeYellow: -> @css(color: 'yellow')
makeGreen: -> @css(color: 'red')
-$('.traffic_light').seem(TrafficLightStylist)
+$('.traffic_light').mixins(TrafficLightStylist)
trafficLight = $('<div />')
.appendTo('body')
@@ -58,7 +58,7 @@ class LoginPopupView = class extends Backbone.View
el: $('#login-popup')
initialize: ->
- @el.seem(LoginPopupStylist)
+ @el.mixins(LoginPopupStylist)
@el.showAnimated()
events:
View
14 spec/javascripts/stylist_spec.coffee
@@ -1,14 +1,14 @@
-describe '$.fn.seem', ->
+describe '$.fn.mixins', ->
it 'should be defined', ->
- expect($.fn.seem).toBeDefined()
- expect($.fn.seem.constructor).toBe(Function)
+ expect($.fn.mixins).toBeDefined()
+ expect($.fn.mixins.constructor).toBe(Function)
describe 'assign stylist functions to DOM elements', ->
beforeEach ->
loadFixtures('base.html')
- $('#with_stylist').seem class
+ $('#with_stylist').mixins class
moveDown: -> @css(marginTop: 10)
it 'should assign functions to DOM elements', ->
@@ -29,7 +29,7 @@ describe '$.fn.seem', ->
describe 'passing arguments', ->
beforeEach ->
loadFixtures('pair.html')
- $('div').seem class
+ $('div').mixins class
moveDown: (num1, num2 = 0) -> @css(marginTop: num1 + num2)
it 'should pass arguments to stylist functions', ->
@@ -42,9 +42,9 @@ describe '$.fn.seem', ->
beforeEach ->
loadFixtures('multiply.html')
- $('#with_stylist_a').seem class
+ $('#with_stylist_a').mixins class
moveDown: -> @css(marginTop: 10)
- $('#with_stylist_b').seem class
+ $('#with_stylist_b').mixins class
moveDown: -> @css(marginTop: 20)
it 'should assign functions to DOM elements', ->
View
2  src/stylist.coffee
@@ -4,7 +4,7 @@ $ = jQuery || Zepto
stylistFunMap = {}
-$.fn.seem = (StylistClass) ->
+$.fn.mixins = (StylistClass) ->
stylist = new StylistClass()
selector = @selector
Please sign in to comment.
Something went wrong with that request. Please try again.