Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 11560e68

Von Bernd Bleßmann vor mehr als 3 Jahren hinzugefügt

  • ID 11560e68081ecc0095a61f408ce1e88314ada07e
  • Vorgänger a758c51f
  • Nachfolger 3e79972f

Dateimanagement: Vorschau auch anklickbar zum Download machen

Unterschiede anzeigen:

css/common.css
233 233
  z-index: 2;
234 234
  cursor: pointer;
235 235
}
236

  
237
.thumbnail {
238
  cursor: pointer;
239
}
js/kivi.File.js
332 332
    $('.thumbnail').on('mouseover', ns.add_enlarged_thumbnail);
333 333
  };
334 334

  
335
  ns.download = function(e) {
336
    var file_id        = $(e.target).data('file-id');
337
    var file_version   = $(e.target).data('file-version');
338

  
339
    var data = {
340
      action:  'File/download',
341
      id:      file_id,
342
      version: file_version,
343
    };
344

  
345
    $.post("controller.pl", data, kivi.eval_json_result);
346

  
347
  };
348

  
335 349
  ns.init = function() {
336 350
    // Preventing page from redirecting
337 351
    $("#" + ns.list_div_id).on("dragover", function(e) {
......
373 387
    });
374 388

  
375 389
    $('.thumbnail').on('mouseover', ns.add_enlarged_thumbnail);
376
    $('.overlay_img').on('click', ns.remove_enlarged_thumbnail);
377 390
    $('.overlay_img').on('mouseout', ns.remove_enlarged_thumbnail);
391
    $('.overlay_div img').on('click', ns.download);
378 392
  };
379 393

  
380 394
});
templates/webpages/file/list.html
70 70
               data-file-id="[% file.id %]" data-file-version="[% file.version %]"
71 71
               src="data:[% HTML.escape(file.thumbnail.thumbnail_img_content_type) %];base64,[% file.thumbnail.thumbnail_img_content.encode_base64 %]"
72 72
               alt="[% file.file_name %]">
73
          <img id="enlarged_thumb_[% file.id %][% IF file.version %]_[% file.version %][% END %]" class="overlay_img" style="display:none;">
73
          <img id="enlarged_thumb_[% file.id %][% IF file.version %]_[% file.version %][% END %]" class="overlay_img" style="display:none;"
74
               data-file-id="[% file.id %]" data-file-version="[% file.version %]">
74 75
         </div>
75 76
        [%- ELSE %]
76 77
         -

Auch abrufbar als: Unified diff