質問編集履歴

2

動作デモを追加

2017/06/16 10:03

投稿

Nanohana
Nanohana

スコア123

test CHANGED
File without changes
test CHANGED
@@ -1,6 +1,12 @@
1
1
  Dropzonejs(http://www.dropzonejs.com)を複数箇所設置して動かしていますが、この時に
2
2
 
3
3
  アップロード済みの画像をダブルクリックしたら画像を削除するシーケンスを入れたいです。
4
+
5
+
6
+
7
+ 動作デモ:https://2nd-train.net/users/submission2ndnewnotmem
8
+
9
+
4
10
 
5
11
  (同時にIDがinsertid1になっている部分の書き換えも実施)ですが、
6
12
 

1

追記

2017/06/16 10:03

投稿

Nanohana
Nanohana

スコア123

test CHANGED
File without changes
test CHANGED
@@ -70,7 +70,39 @@
70
70
 
71
71
  document.getElementById('insertid1').value=xhr.res.insertid;
72
72
 
73
+ },
74
+
75
+ ,init: function() {
76
+
77
+ this.on("addedfile", function(file) {
78
+
79
+
80
+
81
+ file.previewElement.addEventListener(\"dblclick\", function() {
82
+
83
+ console.log("削除シーケンス実行");
84
+
85
+ //アップロード画像をダブルクリックするとこのconsole.logまでは表示されるが、画像の削除ができない
86
+
87
+ //this.removeFile(file); でもダメで、this.removeFile is not a functionのエラーになる。今の表記では$(...).removeFile is not a functionエラーが出る。
88
+
89
+ $('.my-awesome-dropzone1').removeFile(file);
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+ });
98
+
99
+
100
+
101
+ });
102
+
103
+
104
+
73
- }
105
+ }
74
106
 
75
107
  });
76
108