fixed className shortcut on element notification - closes #11

This commit is contained in:
Jaime Pillora
2014-02-06 00:30:03 +11:00
parent a2ec6c036b
commit d5a49073ec
12 changed files with 26 additions and 28 deletions
+1 -1
View File
@@ -34,7 +34,7 @@ module.exports = (grunt) ->
concat: concat:
combined: combined:
src: ['dist/<%= pkg.name %>.js', 'dist/styles/*.js'] src: ['dist/<%= pkg.name %>.js', 'dist/styles/bootstrap/<%= pkg.name %>-bootstrap.js']
dest: 'dist/<%= pkg.name %>-combined.js' dest: 'dist/<%= pkg.name %>-combined.js'
uglify: uglify:
+5 -6
View File
@@ -1,6 +1,6 @@
/** Notify.js - v0.3.1 - 2013/07/05 /** Notify.js - v0.3.1 - 2014/02/06
* http://notifyjs.com/ * http://notifyjs.com/
* Copyright (c) 2013 Jaime Pillora - MIT * Copyright (c) 2014 Jaime Pillora - MIT
*/ */
(function(window,document,$,undefined) { (function(window,document,$,undefined) {
'use strict'; 'use strict';
@@ -303,9 +303,8 @@ Notification = (function() {
}; };
Notification.prototype.setGlobalPosition = function() { Notification.prototype.setGlobalPosition = function() {
var align, anchor, css, key, main, pAlign, pMain, position; var align, anchor, css, key, main, pAlign, pMain, _ref;
position = this.getPosition(); _ref = this.getPosition(), pMain = _ref[0], pAlign = _ref[1];
pMain = position[0], pAlign = position[1];
main = positions[pMain]; main = positions[pMain];
align = positions[pAlign]; align = positions[pAlign];
key = pMain + "|" + pAlign; key = pMain + "|" + pAlign;
@@ -451,7 +450,7 @@ Notification = (function() {
if ($.isPlainObject(options)) { if ($.isPlainObject(options)) {
$.extend(this.options, options); $.extend(this.options, options);
} else if ($.type(options) === 'string') { } else if ($.type(options) === 'string') {
this.options.color = options; this.options.className = options;
} }
if (this.container && !data) { if (this.container && !data) {
this.show(false); this.show(false);
+3 -3
View File
File diff suppressed because one or more lines are too long
+5 -6
View File
@@ -1,6 +1,6 @@
/** Notify.js - v0.3.1 - 2013/07/05 /** Notify.js - v0.3.1 - 2014/02/06
* http://notifyjs.com/ * http://notifyjs.com/
* Copyright (c) 2013 Jaime Pillora - MIT * Copyright (c) 2014 Jaime Pillora - MIT
*/ */
(function(window,document,$,undefined) { (function(window,document,$,undefined) {
'use strict'; 'use strict';
@@ -303,9 +303,8 @@ Notification = (function() {
}; };
Notification.prototype.setGlobalPosition = function() { Notification.prototype.setGlobalPosition = function() {
var align, anchor, css, key, main, pAlign, pMain, position; var align, anchor, css, key, main, pAlign, pMain, _ref;
position = this.getPosition(); _ref = this.getPosition(), pMain = _ref[0], pAlign = _ref[1];
pMain = position[0], pAlign = position[1];
main = positions[pMain]; main = positions[pMain];
align = positions[pAlign]; align = positions[pAlign];
key = pMain + "|" + pAlign; key = pMain + "|" + pAlign;
@@ -451,7 +450,7 @@ Notification = (function() {
if ($.isPlainObject(options)) { if ($.isPlainObject(options)) {
$.extend(this.options, options); $.extend(this.options, options);
} else if ($.type(options) === 'string') { } else if ($.type(options) === 'string') {
this.options.color = options; this.options.className = options;
} }
if (this.container && !data) { if (this.container && !data) {
this.show(false); this.show(false);
+3 -3
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"source": "~/.grunt-sources/web", "source": "~/.grunt-sources/web",
"repo": "https://github.com/jpillora/grunt-source-web.git", "repo": "https://github.com/jpillora/grunt-source-web",
"output": { "output": {
"html": "../index.html" "html": "../index.html"
} }
+1 -1
View File
@@ -8,7 +8,7 @@
| Contributing more styles is easy! | Contributing more styles is easy!
ol ol
li. li.
Click <a href="https://github.com/jpillora/notifyjs/new/master/src/styles" target="_blank">this</a> link Click <a href="https://github.com/jpillora/notifyjs/new/gh-pages/src/styles" target="_blank">this</a> link
li Sign into GitHub (if you're not already) li Sign into GitHub (if you're not already)
li Click 'Fork' li Click 'Fork'
li Enter your new style li Enter your new style
+2 -2
View File
@@ -249,7 +249,7 @@
p p
ul.square ul.square
li: a(href="https://github.com/jpillora/notifyjs/tree/master/dist/styles/bootstrap", target="_blank") bootstrap li: a(href="https://github.com/jpillora/notifyjs/tree/gh-pages/dist/styles/bootstrap", target="_blank") bootstrap
ul.square ul.square
li: a(href="https://github.com/jpillora/notifyjs/tree/master/dist/styles/metro", target="_blank") metro li: a(href="https://github.com/jpillora/notifyjs/tree/gh-pages/dist/styles/metro", target="_blank") metro
+2 -4
View File
@@ -329,9 +329,7 @@ class Notification
setGlobalPosition: () -> setGlobalPosition: () ->
position = @getPosition() [pMain, pAlign] = @getPosition()
[pMain, pAlign] = position
main = positions[pMain] main = positions[pMain]
align = positions[pAlign] align = positions[pAlign]
@@ -481,7 +479,7 @@ class Notification
$.extend @options, options $.extend @options, options
#shortcut special case #shortcut special case
else if $.type(options) is 'string' else if $.type(options) is 'string'
@options.color = options @options.className = options
if @container and not data if @container and not data
@show false @show false
+2
View File
@@ -0,0 +1,2 @@
* Styles in CoffeeScript go here, which will be compiled into `dist/styles`
* Styles in JavaScript can go straight in `dist/styles/`