mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2026-09-15 22:31:24 +00:00
Support selectedClass properly in the button widget
This commit is contained in:
@@ -54,8 +54,7 @@ Popup.prototype.triggerPopup = function(options) {
|
||||
// Get the current popup state tiddler
|
||||
var value = options.wiki.getTextReference(options.title,"");
|
||||
// Check if the popup is open by checking whether it matches "(<x>,<y>)"
|
||||
var popupLocationRegExp = /^\((-?[0-9\.E]+),(-?[0-9\.E]+),(-?[0-9\.E]+),(-?[0-9\.E]+)\)$/,
|
||||
state = !popupLocationRegExp.test(value);
|
||||
var state = !this.readPopupState(options.title,value);
|
||||
if("force" in options) {
|
||||
state = options.force;
|
||||
}
|
||||
@@ -71,6 +70,18 @@ Popup.prototype.triggerPopup = function(options) {
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
Returns true if the specified title and text identifies an active popup
|
||||
*/
|
||||
Popup.prototype.readPopupState = function(title,text) {
|
||||
var popupLocationRegExp = /^\((-?[0-9\.E]+),(-?[0-9\.E]+),(-?[0-9\.E]+),(-?[0-9\.E]+)\)$/,
|
||||
result = false;
|
||||
if(this.title === title) {
|
||||
result = popupLocationRegExp.test(text);
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
exports.Popup = Popup;
|
||||
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user