Skip to content

Commit

Permalink
fixed some jshint things
Browse files Browse the repository at this point in the history
  • Loading branch information
turbo-ele committed Sep 25, 2013
1 parent 034be7d commit bd31bb5
Show file tree
Hide file tree
Showing 7 changed files with 140 additions and 109 deletions.
4 changes: 4 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
"globals": {
"require": false,
"define": false
},
"latedef" : true,
"newcap" : true,
"curly" : true,
Expand Down
10 changes: 9 additions & 1 deletion demos/aurajs/header/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</head>
<body>

<div data-aura-component="header@husky" data-aura-button-type="saveDelete"></div>
<div data-aura-component="header@husky" ></div>

<script src="../js/sinon.js"></script>
<script src="../js/jquery.js"></script>
Expand All @@ -34,6 +34,14 @@

app.start().then(function() {
app.logger.log('Aura started...');


setTimeout(function() {
app.sandbox.emit('husky.header.button-type', 'save');
app.sandbox.emit('husky.header.button-state', 'dirty');


}, 500);
});

});
Expand Down
2 changes: 1 addition & 1 deletion dist/husky.js

Large diffs are not rendered by default.

14 changes: 12 additions & 2 deletions husky_components/button/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ define([], function() {
},
disable: function() {
this.sandbox.dom.addClass(this.$el, 'disable');
this.sandbox.dom.removeClass(this.$el, 'pointer');

type.unBindDomEvents.call(this);
},
Expand All @@ -72,6 +71,7 @@ define([], function() {
},
defaults = {
buttonType: 'icon', // type of button [icon, custom]
buttonState: null, // type of button [icon, custom]
instanceName: 'undefined', // name of instance used in events
text: 'undefined', // button text
iconType: 'caution', // button icon
Expand Down Expand Up @@ -112,6 +112,10 @@ define([], function() {

type.init.call(this);

if (!!this.options.buttonState) {
this.changeState(this.options.buttonState);
}

this.bindCustomEvents();
},

Expand All @@ -121,6 +125,7 @@ define([], function() {

bindCustomEvents: function() {
this.sandbox.on(this.getEvent('state'), this.changeState.bind(this));
this.sandbox.on(this.getEvent('set-content'), this.setContent.bind(this));
},

changeState: function(state) {
Expand All @@ -130,6 +135,11 @@ define([], function() {
} else {
throw 'not implemented';
}
},

setContent:function(text, icon) {
console.log("bla");
console.log("this.el", this.$el);
}
}
};
});
Loading

0 comments on commit bd31bb5

Please sign in to comment.