mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-23 10:07:19 +00:00
Add "class" attribute to dropzone widget
This commit is contained in:
parent
bd449a177b
commit
cf46b6b0ff
@ -35,7 +35,7 @@ DropZoneWidget.prototype.render = function(parent,nextSibling) {
|
|||||||
this.execute();
|
this.execute();
|
||||||
// Create element
|
// Create element
|
||||||
var domNode = this.document.createElement("div");
|
var domNode = this.document.createElement("div");
|
||||||
domNode.className = "tc-dropzone";
|
domNode.className = this.dropzoneClass || "tc-dropzone";
|
||||||
// Add event handlers
|
// Add event handlers
|
||||||
if(this.dropzoneEnable) {
|
if(this.dropzoneEnable) {
|
||||||
$tw.utils.addEventListeners(domNode,[
|
$tw.utils.addEventListeners(domNode,[
|
||||||
@ -190,6 +190,7 @@ DropZoneWidget.prototype.handlePasteEvent = function(event) {
|
|||||||
Compute the internal state of the widget
|
Compute the internal state of the widget
|
||||||
*/
|
*/
|
||||||
DropZoneWidget.prototype.execute = function() {
|
DropZoneWidget.prototype.execute = function() {
|
||||||
|
this.dropzoneClass = this.getAttribute("class");
|
||||||
this.dropzoneDeserializer = this.getAttribute("deserializer");
|
this.dropzoneDeserializer = this.getAttribute("deserializer");
|
||||||
this.dropzoneEnable = (this.getAttribute("enable") || "yes") === "yes";
|
this.dropzoneEnable = (this.getAttribute("enable") || "yes") === "yes";
|
||||||
// Make child widgets
|
// Make child widgets
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
caption: dropzone
|
caption: dropzone
|
||||||
created: 20131024141900000
|
created: 20131024141900000
|
||||||
modified: 20200315144454996
|
modified: 20200403103224328
|
||||||
tags: Widgets
|
tags: Widgets
|
||||||
title: DropzoneWidget
|
title: DropzoneWidget
|
||||||
type: text/vnd.tiddlywiki
|
type: text/vnd.tiddlywiki
|
||||||
@ -16,6 +16,7 @@ It sends a [[WidgetMessage: tm-import-tiddlers]] carrying a JSON representation
|
|||||||
|!Attribute |!Description |
|
|!Attribute |!Description |
|
||||||
|deserializer |<<.from-version "5.1.15">> Optional name of deserializer to be used (by default the deserializer is derived from the file extension) |
|
|deserializer |<<.from-version "5.1.15">> Optional name of deserializer to be used (by default the deserializer is derived from the file extension) |
|
||||||
|enable |<<.from-version "5.1.22">> Optional value "no" to disable the dropzone functionality (defaults to "yes") |
|
|enable |<<.from-version "5.1.22">> Optional value "no" to disable the dropzone functionality (defaults to "yes") |
|
||||||
|
|class |<<.from-version "5.1.22">> Optional CSS class to be assigned to the dropzone (defaults to "tc-drag-over") |
|
||||||
|
|
||||||
The list of available deserializers can be inspected by executing `Object.keys($tw.Wiki.tiddlerDeserializerModules).sort().join("\n")` in the browser JavaScript console.
|
The list of available deserializers can be inspected by executing `Object.keys($tw.Wiki.tiddlerDeserializerModules).sort().join("\n")` in the browser JavaScript console.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user