Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image Popup in MainImageModule IMPROVED: #437

Merged
merged 6 commits into from
Apr 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ <h1>Share</h1>
<div class="ple-module-guide col-md-3"><h2>2</h2></div>

<div class="ple-module-content col-md-9 container">
<div class="ple-drag-drop">
<div id="mainImage" class="ple-drag-drop">
Drag an image here to upload.
</div>
<div class="col-md-6 help">
Expand Down
7 changes: 6 additions & 1 deletion src/modules/PublicLab.MainImageModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
module.exports = PublicLab.MainImageModule = PublicLab.Module.extend({

init: function(_editor, options) {


var dragImageI = document.getElementById("mainImage");
var _module = this;

_module.key = 'main_image_url';
Expand Down Expand Up @@ -132,6 +133,10 @@ module.exports = PublicLab.MainImageModule = PublicLab.Module.extend({
progressall: function (e, data) {

var progress = parseInt(data.loaded / data.total * 100, 10);

// For hiding the HTML "Drag an image here to upload." after uploading image.
dragImageI.innerHTML = "";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh hm, is this line duplicated form 136? And, would you mind uploading a GIF of this working just so we can be sure? Thank you!


_module.el.find('.progress .progress-bar').css(
'width',
progress + '%'
Expand Down