mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 18:30:09 +00:00
started migration to jQuery3...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
b357732259
commit
feeee094ce
8
ui (gen4)/ext-lib/jquery.js
vendored
8
ui (gen4)/ext-lib/jquery.js
vendored
File diff suppressed because one or more lines are too long
@ -225,10 +225,17 @@ var CurrentImageIndicatorActions = actions.Actions({
|
|||||||
var w = cur.outerWidth(true)
|
var w = cur.outerWidth(true)
|
||||||
var h = cur.outerHeight(true)
|
var h = cur.outerHeight(true)
|
||||||
|
|
||||||
// keep size same as the image...
|
// accommodate for non-square images...
|
||||||
if(marker.outerWidth() != w || marker.outerHeight() != h){
|
// XXX this might have problems when scaling...
|
||||||
css.width = w
|
if(Math.floor(w) != Math.floor(h)){
|
||||||
css.height = h
|
css.width = w / scale
|
||||||
|
// XXX do we ever need to set height in a ribbon???
|
||||||
|
//css.height = h / scale
|
||||||
|
|
||||||
|
// square image -> let CSS do the work...
|
||||||
|
} else {
|
||||||
|
css.width = ''
|
||||||
|
css.height = ''
|
||||||
}
|
}
|
||||||
|
|
||||||
// update border...
|
// update border...
|
||||||
|
|||||||
@ -653,14 +653,17 @@ var RibbonsPrototype = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// do the calc...
|
// do the calc...
|
||||||
var res = dim == 'height' ? img.outerHeight(true) * scale
|
var res = dim == 'height' ? img.outerHeight(true)
|
||||||
: dim == 'width' ? img.outerWidth(true) * scale
|
: dim == 'width' ? img.outerWidth(true)
|
||||||
: dim == 'max' ?
|
: dim == 'max' ?
|
||||||
Math.max(img.outerHeight(true), img.outerWidth(true)) * scale
|
Math.max(img.outerHeight(true), img.outerWidth(true))
|
||||||
: dim == 'min' ?
|
: dim == 'min' ?
|
||||||
Math.min(img.outerHeight(true), img.outerWidth(true)) * scale
|
Math.min(img.outerHeight(true), img.outerWidth(true))
|
||||||
: null
|
: null
|
||||||
|
|
||||||
|
// XXX needed for jQuery pre 3.0.0
|
||||||
|
//res = res ? res * scale : res
|
||||||
|
|
||||||
// remove the tmp image we created...
|
// remove the tmp image we created...
|
||||||
if(tmp != null){
|
if(tmp != null){
|
||||||
tmp.remove()
|
tmp.remove()
|
||||||
@ -1533,11 +1536,12 @@ var RibbonsPrototype = {
|
|||||||
// compensate for new/removed images...
|
// compensate for new/removed images...
|
||||||
if(reference != null){
|
if(reference != null){
|
||||||
var ref = this.getImage(reference)
|
var ref = this.getImage(reference)
|
||||||
|
var scale = this.scale()
|
||||||
|
|
||||||
// align only if ref is loaded...
|
// align only if ref is loaded...
|
||||||
if(ref.length > 0){
|
if(ref.length > 0){
|
||||||
var gid = this.getElemGID(ref)
|
var gid = this.getElemGID(ref)
|
||||||
var w = ref.outerWidth()
|
var w = ref.outerWidth() / scale
|
||||||
|
|
||||||
// calculate offset...
|
// calculate offset...
|
||||||
// NOTE: this will not work for non-square images...
|
// NOTE: this will not work for non-square images...
|
||||||
@ -1642,6 +1646,7 @@ var RibbonsPrototype = {
|
|||||||
left = left || 0
|
left = left || 0
|
||||||
right = right || 0
|
right = right || 0
|
||||||
reference = this.getImage(reference)
|
reference = this.getImage(reference)
|
||||||
|
var scale = this.scale()
|
||||||
|
|
||||||
var that = this
|
var that = this
|
||||||
|
|
||||||
@ -1687,7 +1692,7 @@ var RibbonsPrototype = {
|
|||||||
// calculate the compensation...
|
// calculate the compensation...
|
||||||
// XXX this assumes that all widths are equal...
|
// XXX this assumes that all widths are equal...
|
||||||
// ...we can't calculate image with unless it is attached...
|
// ...we can't calculate image with unless it is attached...
|
||||||
var l = -left * reference.outerWidth()
|
var l = -left * (reference.outerWidth() / scale)
|
||||||
|
|
||||||
// clear stuff...
|
// clear stuff...
|
||||||
$(marks)
|
$(marks)
|
||||||
@ -1759,7 +1764,7 @@ var RibbonsPrototype = {
|
|||||||
// calculate the compensation...
|
// calculate the compensation...
|
||||||
// XXX this assumes that all widths are equal...
|
// XXX this assumes that all widths are equal...
|
||||||
// ...we can't calculate image with unless it is attached...
|
// ...we can't calculate image with unless it is attached...
|
||||||
var l = c * reference.outerWidth()
|
var l = c * (reference.outerWidth() / scale)
|
||||||
|
|
||||||
requestAnimationFrame(function(){
|
requestAnimationFrame(function(){
|
||||||
transitions || that.preventTransitions(ribbon)
|
transitions || that.preventTransitions(ribbon)
|
||||||
@ -2213,13 +2218,15 @@ var RibbonsPrototype = {
|
|||||||
|
|
||||||
var viewer_p = W > H ? 'landscape' : 'portrait'
|
var viewer_p = W > H ? 'landscape' : 'portrait'
|
||||||
|
|
||||||
|
var scale = this.scale()
|
||||||
|
|
||||||
return $(images).each(function(i, e){
|
return $(images).each(function(i, e){
|
||||||
var image = $(this)
|
var image = $(this)
|
||||||
// orientation...
|
// orientation...
|
||||||
var o = image.attr('orientation')
|
var o = image.attr('orientation')
|
||||||
o = o == null ? 0 : o
|
o = o == null ? 0 : o
|
||||||
var w = image.outerWidth()
|
var w = image.outerWidth() / scale
|
||||||
var h = image.outerHeight()
|
var h = image.outerHeight() / scale
|
||||||
|
|
||||||
// non-square image...
|
// non-square image...
|
||||||
if(w != h){
|
if(w != h){
|
||||||
@ -2279,7 +2286,7 @@ var RibbonsPrototype = {
|
|||||||
var ro = ribbon_set.offset().top
|
var ro = ribbon_set.offset().top
|
||||||
// NOTE: this appears to account for margins...
|
// NOTE: this appears to account for margins...
|
||||||
var io = target.offset().top
|
var io = target.offset().top
|
||||||
var h = target.outerHeight()
|
var h = target.outerHeight() / scale
|
||||||
+ parseFloat(target.css('margin-top'))
|
+ parseFloat(target.css('margin-top'))
|
||||||
+ parseFloat(target.css('margin-bottom'))
|
+ parseFloat(target.css('margin-bottom'))
|
||||||
|
|
||||||
@ -2314,7 +2321,7 @@ var RibbonsPrototype = {
|
|||||||
// NOTE: this appears to account for margins...
|
// NOTE: this appears to account for margins...
|
||||||
var il = target.offset().left
|
var il = target.offset().left
|
||||||
var W = this.viewer.width() * scale
|
var W = this.viewer.width() * scale
|
||||||
var w = (target.outerWidth()
|
var w = (target.outerWidth() / scale
|
||||||
+ parseFloat(target.css('margin-left'))
|
+ parseFloat(target.css('margin-left'))
|
||||||
+ parseFloat(target.css('margin-right'))) * scale
|
+ parseFloat(target.css('margin-right'))) * scale
|
||||||
|
|
||||||
|
|||||||
@ -27,6 +27,13 @@ if(window.require && window.nw){
|
|||||||
|
|
||||||
<!-- jQuery -->
|
<!-- jQuery -->
|
||||||
<script src="ext-lib/jquery.js"></script>
|
<script src="ext-lib/jquery.js"></script>
|
||||||
|
<!--script src="ext-lib\jquery-1.9.1.js"></script-->
|
||||||
|
<!-- migrating to jQuery 1.9.x -->
|
||||||
|
<!--script src="ext-lib/jquery-migrate-1.4.1.js"></script-->
|
||||||
|
<!-- migrating to jQuery 3.x -->
|
||||||
|
<!--script src="ext-lib/jquery-migrate-3.0.0.js"></script-->
|
||||||
|
|
||||||
|
|
||||||
<script src="ext-lib/jquery-ui.js"></script>
|
<script src="ext-lib/jquery-ui.js"></script>
|
||||||
<script src="ext-lib/jquery.ui.touch-punch.min.js"></script>
|
<script src="ext-lib/jquery.ui.touch-punch.min.js"></script>
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user