Skip to content

Commit

Permalink
angular update to 0.3.3
Browse files Browse the repository at this point in the history
fixes a ton of issues when using this with angular and other frameworks
  • Loading branch information
hellsan631 committed Mar 28, 2016
1 parent 8dbb1e7 commit db7ff59
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 11 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "material-avatar",
"description": "simple material design avatars using canvas",
"version": "0.3.0",
"version": "0.3.2",
"homepage": "http://hellsan631.github.io/material-avatar/",
"authors": [
"Mathew Kleppin <[email protected]>"
Expand Down
20 changes: 12 additions & 8 deletions material-avatar.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
throw(new Error('No elements selected/found'));
}

var _this = this;

this.options = {
colorPalette: [
'#1abc9c', '#2ecc71', '#3498db',
Expand All @@ -25,14 +27,8 @@

this.name = 'MaterialAvatar';

for (var prop in options) {
if (options.hasOwnProperty(prop)) {
this.options[prop] = options[prop];
}
}

extend(_this.options, options);
this.elements = elements;
var _this = this;

if (this.elements[0]) {

Expand Down Expand Up @@ -234,7 +230,7 @@
// export
win.MaterialAvatar = MaterialAvatar;

if (jQuery && jQuery.fn) {
if (typeof jQuery !== 'undefined' && typeof jQuery.fn !== 'undefined') {
jQuery.fn.materialAvatar = function(options) {
return this.each(function() {
if (!jQuery.data(this, 'plugin_materialAvatar')) {
Expand All @@ -244,4 +240,12 @@
};
}

function extend(_this, obj) {
for (var i in obj) {
if (obj.hasOwnProperty(i)) {
_this[i] = obj[i];
}
}
}

})(window, document);
2 changes: 1 addition & 1 deletion material-avatar.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "material-avatar",
"description": "simple material design avatars using canvas",
"version": "0.3.0",
"version": "0.3.2",
"main": "material-avatar.js",
"repository": {
"type": "git",
Expand Down Expand Up @@ -33,6 +33,11 @@
"post-install": "bower install"
},
"devDependencies": {
"gulp": "^3.9.1",
"gulp-concat": "^2.6.0",
"gulp-plumber": "^1.1.0",
"gulp-uglify": "^1.5.3",
"gulp-webserver": "^0.9.1",
"randomcolor": "~0.4.0"
},
"authors": [
Expand Down

0 comments on commit db7ff59

Please sign in to comment.