Skip to content

Commit

Permalink
bump version 1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mkhairi committed Mar 18, 2015
1 parent 27a50bc commit 8a229e9
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# alertifyjs-rails

This gem provides [alertify.js](http://alertifyjs.com/) (v1.2.1) for Rails.
This gem provides [alertify.js](http://alertifyjs.com/) (v1.3.0) for Rails.


## Installation
Expand Down
28 changes: 24 additions & 4 deletions app/assets/javascripts/alertify.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @license MIT <http://opensource.org/licenses/mit-license.php>
* @link http://alertifyjs.com
* @module alertifyjs
* @version 1.2.1
* @version 1.3.0
*/
( function ( window ) {
'use strict';
Expand Down Expand Up @@ -44,6 +44,7 @@
overflow:true,
maintainFocus:true,
transition:'pulse',
autoReset:true,
notifier:{
delay:5,
position:'bottom-right'
Expand Down Expand Up @@ -341,6 +342,21 @@
instance.hooks = {};
}

//copy buttons defintion
var buttonsDefinition = [];
if(Array.isArray(setup.buttons)){
for(var b=0;b<setup.buttons.length;b+=1){
var ref = setup.buttons[b],
copy = {};
for (var i in ref) {
if (ref.hasOwnProperty(i)) {
copy[i] = ref[i];
}
}
buttonsDefinition.push(copy);
}
}

var internal = instance.__internal = {
/**
* Flag holding the open state of the dialog
Expand All @@ -358,7 +374,7 @@
activeElement:document.body,
timerIn:undefined,
timerOut:undefined,
buttons: setup.buttons || [],
buttons: buttonsDefinition,
focus: setup.focus,
options: {
title: undefined,
Expand All @@ -368,6 +384,7 @@
pinned: undefined,
movable: undefined,
resizable: undefined,
autoReset: undefined,
closable: undefined,
closableByDimmer: undefined,
maximizable: undefined,
Expand Down Expand Up @@ -493,6 +510,7 @@

instance.set('movable', setup.options.movable === undefined ? alertify.defaults.movable : setup.options.movable);
instance.set('resizable', setup.options.resizable === undefined ? alertify.defaults.resizable : setup.options.resizable);
instance.set('autoReset', setup.options.autoReset === undefined ? alertify.defaults.autoReset : setup.options.autoReset);

instance.set('closable', setup.options.closable === undefined ? alertify.defaults.closable : setup.options.closable);
instance.set('closableByDimmer', setup.options.closableByDimmer === undefined ? alertify.defaults.closableByDimmer : setup.options.closableByDimmer);
Expand Down Expand Up @@ -1693,8 +1711,10 @@
function windowResize(/*event*/) {
for (var x = 0; x < openDialogs.length; x += 1) {
var instance = openDialogs[x];
resetMove(instance);
resetResize(instance);
if (instance.get('autoReset')) {
resetMove(instance);
resetResize(instance);
}
}
}
/**
Expand Down
12 changes: 12 additions & 0 deletions app/assets/stylesheets/alertify.css
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
max-width: 500px;
padding: 24px 24px 0 24px;
outline: 0;
background-color: #fff;
}
.alertify .ajs-dialog.ajs-capture:before {
content: '';
Expand Down Expand Up @@ -73,6 +74,7 @@
margin: -24px;
margin-bottom: 0;
padding: 16px 24px;
background-color: #fff;
}
.alertify .ajs-body {
min-height: 56px;
Expand All @@ -85,6 +87,7 @@
margin-left: -24px;
margin-right: -24px;
min-height: 43px;
background-color: #fff;
}
.alertify .ajs-footer .ajs-buttons.ajs-primary {
text-align: right;
Expand Down Expand Up @@ -848,6 +851,15 @@
padding: 15px;
margin-top: 10px;
}
.alertify-notifier .ajs-message.ajs-success {
background: rgba(91, 189, 114, 0.95);
}
.alertify-notifier .ajs-message.ajs-error {
background: rgba(217, 92, 92, 0.95);
}
.alertify-notifier .ajs-message.ajs-warning {
background: rgba(252, 248, 215, 0.95);
}
.alertify-notifier.ajs-top {
top: 10px;
}
Expand Down
12 changes: 12 additions & 0 deletions app/assets/stylesheets/alertify.rtl.css
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
max-width: 500px;
padding: 24px 24px 0 24px;
outline: 0;
background-color: #fff;
}
.alertify .ajs-dialog.ajs-capture:before {
content: '';
Expand Down Expand Up @@ -73,6 +74,7 @@
margin: -24px;
margin-bottom: 0;
padding: 16px 24px;
background-color: #fff;
}
.alertify .ajs-body {
min-height: 56px;
Expand All @@ -85,6 +87,7 @@
margin-right: -24px;
margin-left: -24px;
min-height: 43px;
background-color: #fff;
}
.alertify .ajs-footer .ajs-buttons.ajs-primary {
text-align: left;
Expand Down Expand Up @@ -848,6 +851,15 @@
padding: 15px;
margin-top: 10px;
}
.alertify-notifier .ajs-message.ajs-success {
background: rgba(91, 189, 114, 0.95);
}
.alertify-notifier .ajs-message.ajs-error {
background: rgba(217, 92, 92, 0.95);
}
.alertify-notifier .ajs-message.ajs-warning {
background: rgba(252, 248, 215, 0.95);
}
.alertify-notifier.ajs-top {
top: 10px;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/alertifyjs/rails/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Alertifyjs #:nodoc:
module Rails #:nodoc:
VERSION = "1.2.1"
VERSION = "1.3.0"
end
end

0 comments on commit 8a229e9

Please sign in to comment.