allow user-specified buttonText to override buttonIcons

This commit is contained in:
Adam Shaw
2014-05-21 17:00:51 -07:00
parent 107cf134f2
commit dda017efe2
44 changed files with 89 additions and 84 deletions
+7 -3
View File
@@ -72,17 +72,21 @@ function Header(calendar, options) {
// smartProperty allows different text per view button (ex: "Agenda Week" vs "Basic Week")
var themeIcon = smartProperty(options.themeButtonIcons, buttonName);
var normalIcon = smartProperty(options.buttonIcons, buttonName);
var text = smartProperty(options.buttonText, buttonName);
var defaultText = smartProperty(options.defaultButtonText, buttonName);
var customText = smartProperty(options.buttonText, buttonName);
var html;
if (themeIcon && options.theme) {
if (customText) {
html = htmlEscape(customText);
}
else if (themeIcon && options.theme) {
html = "<span class='ui-icon ui-icon-" + themeIcon + "'></span>";
}
else if (normalIcon && !options.theme) {
html = "<span class='fc-icon fc-icon-" + normalIcon + "'></span>";
}
else {
html = htmlEscape(text || buttonName);
html = htmlEscape(defaultText || buttonName);
}
var button = $(
+1 -1
View File
@@ -49,7 +49,7 @@ var defaults = {
// locale
isRTL: false,
buttonText: {
defaultButtonText: {
prev: "prev",
next: "next",
prevYear: "prev year",
+1 -1
View File
@@ -23,7 +23,7 @@ fc.datepickerLang = function(langCode, datepickerLangCode, options) {
'YYYY[' + options.yearSuffix + '] MMMM' :
'MMMM YYYY[' + options.yearSuffix + ']'
},
buttonText: {
defaultButtonText: {
// the translations sometimes wrongly contain HTML entities
prev: stripHTMLEntities(options.prevText),
next: stripHTMLEntities(options.nextText),
+1
View File
@@ -159,6 +159,7 @@ function arrayMax(a) {
function smartProperty(obj, name) { // get a camel-cased/namespaced property of an object
obj = obj || {};
if (obj[name] !== undefined) {
return obj[name];
}