Skip to content

Commit

Permalink
Merge pull request #23 from invertase/development
Browse files Browse the repository at this point in the history
Merge in development branch
  • Loading branch information
Ehesp committed Aug 6, 2015
2 parents d3f4686 + ec8ec74 commit b7553f6
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 5 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,13 @@ toasty.error();
toasty.warning();
```
To create a "quick toast", just pass a string or integer to the function instead:
```javascript
toasty('Quick Toast!');
toasty.success('Quick Success Toast!');
```
##### Event Handlers & Broadcasting
You can easily hook into individual toast item events by calling a functions:
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "angular-toasty",
"description": "A slick, simple, standalone AngularJS module with extensive features that provides growl-style alerts and messages for your app.",
"version": "1.0.1",
"version": "1.0.2",
"main": [
"dist/angular-toasty.js",
"dist/angular-toasty.css"
Expand Down
7 changes: 7 additions & 0 deletions dist/angular-toasty.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,13 @@ angular.module('angular-toasty').factory('toasty', ['$rootScope', 'toastyConfig'
* @param {string} type Type of toasty; success, info, error etc.
*/
var toasty = function(options, type) {

if (angular.isString(options) && options != '' || angular.isNumber(options)) {
options = {
title: options.toString()
};
}

if (!options || !options.title && !options.msg) {
console.error('angular-toasty: No toast title or message specified!');
} else {
Expand Down
2 changes: 1 addition & 1 deletion dist/angular-toasty.min.js

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions example/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ angular.module('toasty-example').controller('ExampleController', ['$scope', 'toa

$scope.button = $scope.button == 'ping' ? 'pong' : 'ping';

console.log(toasty.getGlobalConfig())

toasty[$scope.options.type]({
title: $scope.options.title,
msg: $scope.options.msg,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-toasty",
"version": "1.0.1",
"version": "1.0.2",
"author": "Invertase",
"devDependencies": {
"bower": "~1.4.1",
Expand Down
7 changes: 7 additions & 0 deletions src/js/service.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ angular.module('angular-toasty').factory('toasty', ['$rootScope', 'toastyConfig'
* @param {string} type Type of toasty; success, info, error etc.
*/
var toasty = function(options, type) {

if (angular.isString(options) && options != '' || angular.isNumber(options)) {
options = {
title: options.toString()
};
}

if (!options || !options.title && !options.msg) {
console.error('angular-toasty: No toast title or message specified!');
} else {
Expand Down

0 comments on commit b7553f6

Please # to comment.