Add "class" attribute to dropzone widget

This commit is contained in:
Jeremy Ruston
2020-04-03 10:33:39 +01:00
parent bd449a177b
commit cf46b6b0ff
2 changed files with 4 additions and 2 deletions

View File

@@ -35,7 +35,7 @@ DropZoneWidget.prototype.render = function(parent,nextSibling) {
this.execute();
// Create element
var domNode = this.document.createElement("div");
domNode.className = "tc-dropzone";
domNode.className = this.dropzoneClass || "tc-dropzone";
// Add event handlers
if(this.dropzoneEnable) {
$tw.utils.addEventListeners(domNode,[
@@ -190,6 +190,7 @@ DropZoneWidget.prototype.handlePasteEvent = function(event) {
Compute the internal state of the widget
*/
DropZoneWidget.prototype.execute = function() {
this.dropzoneClass = this.getAttribute("class");
this.dropzoneDeserializer = this.getAttribute("deserializer");
this.dropzoneEnable = (this.getAttribute("enable") || "yes") === "yes";
// Make child widgets