Permalink
Browse files

Messi 1.2: minor css and js fixes for IE.

  • Loading branch information...
1 parent 053b3be commit c59fe492bcab75ecbe8b0155ce521831c38b8892 @marcosesperon committed May 10, 2012
Showing with 15 additions and 14 deletions.
  1. +1 −0 messi.css
  2. +11 −11 messi.js
  3. +1 −1 messi.min.css
  4. +2 −2 messi.min.js
View
@@ -43,6 +43,7 @@
font: 1.3em bold helvetica, arial;
color: #fff;
text-shadow: 0 -2px 1px rgba(0, 0, 0, 0.25);
+ background-color: #3b3b3b;
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0.25, #3b3b3b), color-stop(0.75, #575757));
background-image: linear-gradient(bottom, #3b3b3b 25%, #575757 75%);
background-image: -moz-linear-gradient(bottom, #3b3b3b 25%, #575757 75%);
View
@@ -1,5 +1,5 @@
/*
- * jQuery Messi Plugin 1.1
+ * jQuery Messi Plugin 1.2
* https://github.com/marcosesperon/jquery-messi
*
* Copyright 2012, Marcos Esperón
@@ -54,8 +54,9 @@ function Messi(data, options) {
for (var i = 0; i < _this.options.buttons.length; i++) {
- var cls = (_this.options.buttons[i].class) ? _this.options.buttons[i].class : '';
- var btn = jQuery('<div class="btnbox"><button class="btn ' + cls + '" href="#">' + _this.options.buttons[i].label + '</button></div>').data('value', _this.options.buttons[i].val);
+ var cls = (_this.options.buttons[i].btnClass) ? _this.options.buttons[i].btnClass : '';
+ var val = (_this.options.buttons[i].val) ? _this.options.buttons[i].val : '';
+ var btn = jQuery('<div class="btnbox"><button class="btn ' + cls + '" href="#">' + _this.options.buttons[i].label + '</button></div>').data('value', val);
btn.bind('click', function() {
var value = jQuery.data(this, 'value');
var after = (_this.options.callback != null) ? function() { _this.options.callback(value); } : null;
@@ -156,9 +157,6 @@ Messi.prototype = {
this.messi.css({top: this.options.viewport.top, left: this.options.viewport.left, 'z-index': this.options.zIndex + jQuery('.messi').length}).show().animate({opacity: 1}, 300);
- // cancelamos el scroll
- //document.documentElement.style.overflow = "hidden";
-
this.visible = true;
},
@@ -210,19 +208,22 @@ jQuery.extend(Messi, {
alert: function(data, callback, options) {
- var buttons = [{id: 'ok', label: 'OK', val: 'OK'}];
+ var btntxt = (options.btnText) ? options.btnText : 'OK';
+ var buttons = [{id: 'ok', label: btntxt}];
- options = jQuery.extend({closeButton: false, buttons: buttons, callback:function() {}}, options || {}, {show: true, unload: true, callback: callback});
+ options = jQuery.extend({closeButton: false, modal: true, buttons: buttons, callback:function() {}}, options || {}, {show: true, unload: true, callback: callback});
return new Messi(data, options);
},
ask: function(data, callback, options) {
+ var btnyestxt = (options.btnYesText) ? options.btnYesText : 'Yes';
+ var btnnotxt = (options.btnNoText) ? options.btnNoText : 'No';
var buttons = [
- {id: 'yes', label: 'Yes', val: 'Y', class: 'btn-success'},
- {id: 'no', label: 'No', val: 'N', class: 'btn-danger'},
+ {id: 'yes', label: btnyestxt, val: 'Y', btnClass: 'btn-success'},
+ {id: 'no', label: btnnotxt, val: 'N', btnClass: 'btn-danger'},
];
options = jQuery.extend({closeButton: false, modal: true, buttons: buttons, callback:function() {}}, options || {}, {show: true, unload: true, callback: callback});
@@ -265,7 +266,6 @@ jQuery.extend(Messi, {
console.log(request.responseText);
},
success: function(html) {
- //html = jQuery(html);
new Messi(html, options);
}
};
Oops, something went wrong.

2 comments on commit c59fe49

@siraero

Hi Marcosesperon

Great job. but i need some help.

  1. in the button ex. u have the yes and no button is not getting any color, everythings else is working.
  2. Can u provide us with an body Onload ex or an ex that can be runned on page_load, i cant get it to work with the show:true code.
@marcosesperon
Owner

Hi siraero,

  1. Look at the yes/no/cancel example. You need to specify the btnClass attribute to set color at the button.
  2. You can use document.ready from jQuery:

$(document).ready(function() {
new Messi('This is a message with Messi.', {title: 'Title', titleClass: 'success', buttons: [{id: 0, label: 'Close', val: 'X'}]});
});

Please sign in to comment.