-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ef1fc12
commit 9801db1
Showing
4 changed files
with
79 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<div class="ui modal image-preview-modal {{ class }}" id="image_preview_modal"> | ||
<div class="header {{ header_class }}"> | ||
<i class="image-modal-icon icon blue large image outline {{ dialogs.confirm.icon }}"></i> | ||
<span class="image-modal-title">{{ labels.title }}</span> | ||
</div> | ||
<div class="image content image-modal-description" id="image_modal_content"> | ||
<img class="image rounded bordered" data-src="" id="image_preview"> | ||
</div> | ||
<div class="actions"> | ||
<button class="ui blue approve button {{ buttons.close.class }}">{{ buttons.close.content }}</button> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/** | ||
* Arikaim | ||
* @copyright Copyright (c) Konstantin Atanasov <[email protected]> | ||
* @license http://www.arikaim.com/license | ||
* http://www.arikaim.com | ||
*/ | ||
"use strict"; | ||
|
||
function ImagePreviewModal() { | ||
var self = this; | ||
|
||
this.loadCode = function() { | ||
arikaim.component.loadContent('components:image.modal',function(result) { | ||
$('body').append(result.html); | ||
}); | ||
}; | ||
|
||
this.show = function(options) { | ||
var modalId = getValue('id',options,'image_preview_modal'); | ||
var title = getValue('title',options,null); | ||
var description = getValue('description',options,null); | ||
var images = getValue('images',options,[]); | ||
var icon = getValue('icon',options,null); | ||
var hideIcon = getValue('hideIcon',options,null); | ||
|
||
images.forEach(function(item) { | ||
console.log(item); | ||
$('#image_preview').attr('data-src',item); | ||
}); | ||
if (isEmpty(title) == false) { | ||
$('#' + modalId + ' .image-modal-title').html(title); | ||
} | ||
if (isEmpty(description) == false) { | ||
$('#' + modalId + ' .image-modal-description').html(description); | ||
} | ||
if (isEmpty(icon) == false) { | ||
$('#' + modalId + ' .image-modal-icon').attr('class','icon modal-icon ' + icon); | ||
} | ||
if (isEmpty(hideIcon) == false) { | ||
$('#' + modalId + ' .image-modal-icon').hide(); | ||
} | ||
// show modal | ||
$('#' + modalId).modal({}).modal('show'); | ||
// load images | ||
arikaim.ui.initImageLoader(); | ||
}; | ||
} | ||
|
||
var imagePreviewModal = new ImagePreviewModal(); | ||
|
||
$(document).ready(function() { | ||
imagePreviewModal.loadCode(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"labels": { | ||
"title": "Image" | ||
}, | ||
"buttons": { | ||
"close": { | ||
"content": "Close" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,4 +68,7 @@ function Modal() { | |
} | ||
|
||
var modal = new Modal(); | ||
modal.init(); | ||
|
||
$(document).ready(function() { | ||
modal.init(); | ||
}); |