Skip to content

Commit

Permalink
allow configuration of guider buttons (element, html attibutes)
Browse files Browse the repository at this point in the history
  • Loading branch information
Michal Cichra committed Mar 21, 2012
1 parent 4709299 commit db7cf9c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions guiders-1.2.3.js
Expand Up @@ -61,6 +61,8 @@ var guiders = (function($) {
guiders._guiders = {};
guiders._lastCreatedGuiderID = null;
guiders._nextButtonTitle = "Next";
guiders._buttonElement = "<a/>";
guiders._buttonAttributes = {"href": "#"};

guiders._addButtons = function(myGuider) {
// Add buttons
Expand All @@ -73,9 +75,11 @@ var guiders = (function($) {

for (var i = myGuider.buttons.length-1; i >= 0; i--) {
var thisButton = myGuider.buttons[i];
var thisButtonElem = $("<a></a>", {
"class" : "guider_button",
"html" : thisButton.name });
var thisButtonElem = $(guiders._buttonElement, $.extend({
"class" : "guider_button",
"html" : thisButton.name },
guiders._buttonAttributes, thisButton.html || {}));

if (typeof thisButton.classString !== "undefined" && thisButton.classString !== null) {
thisButtonElem.addClass(thisButton.classString);
}
Expand Down

0 comments on commit db7cf9c

Please sign in to comment.