Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
sravnitel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
sravnitel
Commits
197e220f
Commit
197e220f
authored
Jan 23, 2017
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. +height change to js 2. switched to WPs versions of jquery-ui-draggable
parent
e51bd9e5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
12 deletions
+15
-12
jquery.sravnitel.js
assets/js/jquery.sravnitel.js
+13
-7
enqueue.php
inc/enqueue.php
+2
-5
No files found.
assets/js/jquery.sravnitel.js
View file @
197e220f
...
@@ -271,7 +271,11 @@
...
@@ -271,7 +271,11 @@
});
});
zoom_info
.
on
(
"click"
,
function
(){
zoom_info
.
on
(
"click"
,
function
(){
set_zoom
(
0
,
0
,
settings
.
width
);
var
z
=
settings
.
width
/
$
(
"#display_window_0 .zoomable"
)[
0
].
naturalWidth
;
var
height
=
z
*
$
(
"#display_window_0 .zoomable"
)[
0
].
naturalHeight
;
set_zoom
(
0
,
0
,
settings
.
width
,
height
);
});
});
elem
.
append
(
zoom_info
);
elem
.
append
(
zoom_info
);
...
@@ -292,7 +296,7 @@
...
@@ -292,7 +296,7 @@
//disable initial zoom
//disable initial zoom
settings
.
zoom
=
0
;
settings
.
zoom
=
0
;
set_zoom
(
i_top
,
i_left
,
i_width
);
set_zoom
(
i_top
,
i_left
,
i_width
,
i_height
);
}
}
update_zoom_info
();
update_zoom_info
();
...
@@ -455,24 +459,26 @@
...
@@ -455,24 +459,26 @@
if
(
new_zoom
==
0
)
new_zoom
=
0.05
;
if
(
new_zoom
==
0
)
new_zoom
=
0.05
;
new_width
=
new_zoom
*
old_width
/
old_zoom
;
new_width
=
new_zoom
*
old_width
/
old_zoom
;
new_height
=
new_zoom
*
old_height
/
old_zoom
;
k
=
new_width
/
old_width
;
k
=
new_width
/
old_width
;
new_x
=
x
-
k
*
old_x
;
new_x
=
x
-
k
*
old_x
;
new_y
=
y
-
k
*
old_y
;
new_y
=
y
-
k
*
old_y
;
set_zoom
(
new_y
,
new_x
,
new_width
);
set_zoom
(
new_y
,
new_x
,
new_width
,
new_height
);
}
}
function
set_zoom
(
top
,
left
,
width
){
function
set_zoom
(
top
,
left
,
width
,
height
){
$
(
".display_window"
).
each
(
function
(){
$
(
".display_window"
).
each
(
function
(){
var
tmp_elem
=
$
(
this
).
find
(
".zoomable"
);
var
tmp_elem
=
$
(
this
).
find
(
".zoomable"
);
tmp_elem
.
css
({
tmp_elem
.
css
({
top
:
top
+
"px"
,
top
:
top
+
"px"
,
left
:
left
-
$
(
this
).
position
().
left
+
"px"
,
left
:
left
-
$
(
this
).
position
().
left
+
"px"
,
width
:
width
+
"px"
width
:
width
+
"px"
,
height
:
height
+
"px"
});
});
});
});
update_zoom_info
();
update_zoom_info
();
...
@@ -543,7 +549,7 @@
...
@@ -543,7 +549,7 @@
}(
jQuery
));
}(
jQuery
));
function
touchHandler
(
event
)
{
function
touchHandler
_not_used
(
event
)
{
var
touch
=
event
.
changedTouches
[
0
];
var
touch
=
event
.
changedTouches
[
0
];
var
simulatedEvent
=
document
.
createEvent
(
"MouseEvent"
);
var
simulatedEvent
=
document
.
createEvent
(
"MouseEvent"
);
...
@@ -562,7 +568,7 @@ function touchHandler(event) {
...
@@ -562,7 +568,7 @@ function touchHandler(event) {
}
}
function
init_touch
(
element
)
{
function
init_touch
_not_used
(
element
)
{
document
.
addEventListener
(
"touchstart"
,
touchHandler
,
true
);
document
.
addEventListener
(
"touchstart"
,
touchHandler
,
true
);
document
.
addEventListener
(
"touchmove"
,
touchHandler
,
true
);
document
.
addEventListener
(
"touchmove"
,
touchHandler
,
true
);
document
.
addEventListener
(
"touchend"
,
touchHandler
,
true
);
document
.
addEventListener
(
"touchend"
,
touchHandler
,
true
);
...
...
inc/enqueue.php
View file @
197e220f
...
@@ -22,11 +22,8 @@
...
@@ -22,11 +22,8 @@
function
sravnitel_enqueue_script
(
$hook
){
function
sravnitel_enqueue_script
(
$hook
){
wp_enqueue_style
(
'style1'
,
SRAVNITEL_URL
.
'/assets/css/sravnitel.css'
);
wp_enqueue_style
(
'sravnitel-style'
,
SRAVNITEL_URL
.
'/assets/css/sravnitel.css'
);
wp_enqueue_script
(
'sravnitel'
,
SRAVNITEL_URL
.
'/assets/js/jquery.sravnitel.js'
,
array
(
'jquery-ui-draggable'
));
//wp_enqueue_script( 'script1', SRAVNITEL_URL.'/assets/js/jquery-3.1.1.js', array( 'jquery' ));
wp_enqueue_script
(
'script2'
,
SRAVNITEL_URL
.
'/assets/js/jquery.sravnitel.js'
,
array
(
'jquery'
));
wp_enqueue_script
(
'script3'
,
SRAVNITEL_URL
.
'/assets/js/jquery-ui-1.12.1/jquery-ui.js'
,
array
(
'jquery'
));
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment