1
0
Fork 0

Remove image viewer

This commit is contained in:
Alex Kotov 2019-07-08 17:32:17 +05:00
parent f97e77e813
commit c9b6f6b2d8
Signed by: kotovalexarian
GPG key ID: 553C0EBBEB5D5F08
4 changed files with 0 additions and 58 deletions

View file

@ -4,50 +4,4 @@
//= require jquery3 //= require jquery3
//= require popper //= require popper
//= require bootstrap-sprockets //= require bootstrap-sprockets
//= require viewerjs/dist/viewer
//= require jquery-viewer/dist/jquery-viewer
//= require_tree . //= require_tree .
$(document).ready(function() {
$('#image').passportImageViewer()
$("input[name='passport[images]']").change(function() {
if (!this.files) { return }
var file = this.files[0]
if (!file) { return }
var reader = new FileReader()
reader.onload = function(e) {
$('#image').attr('src', e.target.result)
$('#image').passportImageViewer()
}
reader.readAsDataURL(file)
})
})
$.fn.passportImageViewer = function() {
$(this).viewer('destroy')
$(this).viewer({
inline: true,
title: false,
navbar: false,
toolbar: {
zoomIn: true,
zoomOut: true,
oneToOne: true,
reset: true,
prev: false,
play: false,
next: false,
rotateLeft: true,
rotateRight: true,
flipHorizontal: true,
flipVertical: true,
},
})
}

View file

@ -1,4 +1,3 @@
@import 'bootstrap'; @import 'bootstrap';
@import 'font-awesome-sprockets'; @import 'font-awesome-sprockets';
@import 'font-awesome'; @import 'font-awesome';
@import 'viewerjs/dist/viewer';

View file

@ -7,7 +7,5 @@
"license": "MIT", "license": "MIT",
"version": "0.0.0", "version": "0.0.0",
"dependencies": { "dependencies": {
"jquery-viewer": "^1.0.0",
"viewerjs": "^1.3.0"
} }
} }

View file

@ -2,12 +2,3 @@
# yarn lockfile v1 # yarn lockfile v1
jquery-viewer@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/jquery-viewer/-/jquery-viewer-1.0.0.tgz#84dc26d39b4499d8f21fa146d35bd52f5f813f11"
integrity sha512-j1f7AKNU+wjywS8CwtHzDymyoroUznoXnrRp87WIRVuzZzMoFtJCrj54F/0BAi2DIEkDHx/1EZl9N725M6LiIA==
viewerjs@^1.3.0:
version "1.3.2"
resolved "https://registry.yarnpkg.com/viewerjs/-/viewerjs-1.3.2.tgz#67781aff6d019a0960c4c2bf74d6756b548aebf8"
integrity sha512-P9Ac9H+GJ1jE9B5x8foRYm/xZvpWFR6L4GC9mr6181P9amOzQPDkplQrFj8l7mdnv8EyH2dO8XJJfoylir316A==