pawelrojek / mantisbt-pastezone

Paste screenshots, pictures or files from clipboard directly into 'Issue Details' form
GNU General Public License v3.0
8 stars 2 forks source link

Upgrade to Mantis 2.4 breaks PasteZone Plugin #1

Closed johgoe closed 7 years ago

johgoe commented 7 years ago

Cause of this change #22673 (see also https://github.com/mantisbt/mantisbt/pull/1082/commits/90b19da4ac4c4862dc6563b0933bb05a44b25869) the statements

if ($(".dropzone-form").length>0) myDropzone = Dropzone.forElement(".dropzone-form");
if ($(".auto-dropzone-form").length>0) myDropzone = Dropzone.forElement(".auto-dropzone-form");

returns no myDropzone Object anymore.

A fix could be e.g.

if ($( 'form .dropzone' ).length>0) {
  var classPrefix = 'dropzone';
  var zone_class =  '.' + classPrefix;
  var zone = $( zone_class );
  var form = zone.closest('form');
  myDropzone = Dropzone.forElement(form[0]);
}
pawelrojek commented 7 years ago

Fixed in 1.0.1.