mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-03-27 05:46:55 +00:00
Fix refresh for all attributes of droppable widget. Add disabled class (#5280)
This commit is contained in:
parent
f968130696
commit
1e9cc2b747
@ -50,6 +50,8 @@ DroppableWidget.prototype.render = function(parent,nextSibling) {
|
||||
{name: "dragleave", handlerObject: this, handlerMethod: "handleDragLeaveEvent"},
|
||||
{name: "drop", handlerObject: this, handlerMethod: "handleDropEvent"}
|
||||
]);
|
||||
} else {
|
||||
$tw.utils.addClass(this.domNode,this.disabledClass);
|
||||
}
|
||||
// Insert element
|
||||
parent.insertBefore(domNode,nextSibling);
|
||||
@ -145,6 +147,7 @@ DroppableWidget.prototype.execute = function() {
|
||||
this.droppableEffect = this.getAttribute("effect","copy");
|
||||
this.droppableTag = this.getAttribute("tag");
|
||||
this.droppableEnable = (this.getAttribute("enable") || "yes") === "yes";
|
||||
this.disabledClass = this.getAttribute("disabledClass","");
|
||||
// Make child widgets
|
||||
this.makeChildWidgets();
|
||||
};
|
||||
@ -160,7 +163,7 @@ Selectively refreshes the widget if needed. Returns true if the widget or any of
|
||||
*/
|
||||
DroppableWidget.prototype.refresh = function(changedTiddlers) {
|
||||
var changedAttributes = this.computeAttributes();
|
||||
if(changedAttributes.tag || changedAttributes.enable) {
|
||||
if(changedAttributes.tag || changedAttributes.enable || changedAttributes.disabledClass || changedAttributes.actions || changedAttributes.effect) {
|
||||
this.refreshSelf();
|
||||
return true;
|
||||
} else if(changedAttributes["class"]) {
|
||||
@ -171,4 +174,4 @@ DroppableWidget.prototype.refresh = function(changedTiddlers) {
|
||||
|
||||
exports.droppable = DroppableWidget;
|
||||
|
||||
})();
|
||||
})();
|
Loading…
x
Reference in New Issue
Block a user