mirror of
https://github.com/taroved/pol
synced 2025-05-30 21:10:09 -07:00
hover logic (test version)
This commit is contained in:
parent
2a81c5d5c9
commit
3b440fd70e
@ -346,23 +346,30 @@ function onIframeElementClick(event) {
|
|||||||
currentItem.onSelectionElementClick(this);
|
currentItem.onSelectionElementClick(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
var previous_hover_element = [];
|
function onIframeElementHover(event, p1, p2, p3) {
|
||||||
|
|
||||||
function onIframeElementHover(event) {
|
|
||||||
event.stopPropagation();
|
|
||||||
|
|
||||||
if (!currentItem)
|
if (!currentItem)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ($(this).prop("tagName")) // is not document object
|
if ($(this).prop("tagName")) // is document element
|
||||||
if (currentItem.state == STATE_SELECTING)
|
if (currentItem.state == STATE_SELECTING)
|
||||||
if (event.type == 'mouseenter') {
|
if (event.type == 'mouseenter') {
|
||||||
|
// clear all hover styles
|
||||||
|
styleTool.unstyleAll('hover');
|
||||||
styleTool.style(this, 'hover');
|
styleTool.style(this, 'hover');
|
||||||
|
event.stopPropagation()
|
||||||
}
|
}
|
||||||
else { // mouseleave
|
else { // mouseleave
|
||||||
// clear all hover styles
|
styleTool.unstyle(this, 'hover');
|
||||||
// if mouseleave calls after mouseenter we may have a problem
|
// style parent document element
|
||||||
styleTool.unstyleAll('hover');
|
var element = this;
|
||||||
|
while (element) {
|
||||||
|
element = element.parentNode;
|
||||||
|
if ($(element).prop("tagName")) {
|
||||||
|
styleTool.style(element, 'hover');
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -469,6 +476,8 @@ function loader(show) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
|
loader(true);
|
||||||
|
|
||||||
items['title'] = new Item('title', $('#st-title')[0]);
|
items['title'] = new Item('title', $('#st-title')[0]);
|
||||||
items['description'] = new Item('description', $('#st-description')[0]);
|
items['description'] = new Item('description', $('#st-description')[0]);
|
||||||
|
|
||||||
@ -482,9 +491,9 @@ $(document).ready(function(){
|
|||||||
// attach iframe elements event handlers
|
// attach iframe elements event handlers
|
||||||
$('iframe').contents().on('click', '*[tag-id]', onIframeElementClick);
|
$('iframe').contents().on('click', '*[tag-id]', onIframeElementClick);
|
||||||
$('iframe').contents().on('mouseenter mouseleave', '*[tag-id]', onIframeElementHover);
|
$('iframe').contents().on('mouseenter mouseleave', '*[tag-id]', onIframeElementHover);
|
||||||
|
loader(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
blinkButton($('#st-title'), 3);
|
|
||||||
$('#st-title').tooltip('show');
|
$('#st-title').tooltip('show');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user