toogle with mouseover
This commit is contained in:
parent
81c476c1bb
commit
9f4f788519
|
@ -681,40 +681,8 @@ function staEx(mode) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
function toggleAction(id) {
|
function toggleAction(id) {
|
||||||
console.log(document.getElementById(id))
|
const elm = document.getElementById(id)
|
||||||
var instance = M.Dropdown.init(document.getElementById(id));
|
const instance = M.Dropdown.init(elm);
|
||||||
|
console.log(instance.isOpen)
|
||||||
instance.open()
|
instance.open()
|
||||||
return
|
|
||||||
var height = ct * 39 + 6
|
|
||||||
var cont = elem.parents('.cvo').find('.contextMenu')
|
|
||||||
if (cont.hasClass('hide')) {
|
|
||||||
$('#contextWrap').removeClass('hide')
|
|
||||||
var left = elem.offset().left + 60
|
|
||||||
var top = elem.offset().top - height
|
|
||||||
if (top < 75) {
|
|
||||||
top = elem.offset().top + 45
|
|
||||||
cont.removeClass('bottom')
|
|
||||||
cont.addClass('top')
|
|
||||||
} else {
|
|
||||||
top = elem.offset().top - 105
|
|
||||||
cont.removeClass('top')
|
|
||||||
cont.addClass('bottom')
|
|
||||||
}
|
|
||||||
if (elem.parents('.cvo').attr('id') == 'toot-this') {
|
|
||||||
console.log($('#toot-this').offset().top, elem.offset().top)
|
|
||||||
left = $('#toot-this').offset().left + elem.offset().left + 10
|
|
||||||
top = $('#toot-this').offset().top - $('#toot-this').height() - height + 25
|
|
||||||
}
|
|
||||||
cont.css('top', top + 'px')
|
|
||||||
cont.css('right', `calc(100vw - ${left}px)`)
|
|
||||||
cont.removeClass('hide')
|
|
||||||
elem
|
|
||||||
.parents('.cvo')
|
|
||||||
.find('.act-icon')
|
|
||||||
.text('expand_less')
|
|
||||||
} else {
|
|
||||||
$('#contextWrap').addClass('hide')
|
|
||||||
$('.contextMenu').addClass('hide')
|
|
||||||
$('.act-icon').text('expand_more')
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -335,6 +335,13 @@ function cardCheck(tlid) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function mov(id, tlid, type) {
|
function mov(id, tlid, type) {
|
||||||
|
const dropdownTrigger = `dropdown_${tlid}_${id}`
|
||||||
|
const elm = document.getElementById(dropdownTrigger)
|
||||||
|
const instance = M.Dropdown.getInstance(elm)
|
||||||
|
if(instance) {
|
||||||
|
if(instance.isOpen) return false
|
||||||
|
}
|
||||||
|
|
||||||
var click = false
|
var click = false
|
||||||
if (tlid == 'notf') {
|
if (tlid == 'notf') {
|
||||||
var tlide = '[data-notf=' + acct_id + ']'
|
var tlide = '[data-notf=' + acct_id + ']'
|
||||||
|
@ -361,9 +368,9 @@ function mov(id, tlid, type) {
|
||||||
}
|
}
|
||||||
if (mouseover == 'hide') {
|
if (mouseover == 'hide') {
|
||||||
if (click) {
|
if (click) {
|
||||||
$(tlide + ' [toot-id=' + id + ']').toggleClass('hide-actions')
|
$(tlide + ' [unique-id=' + id + ']').toggleClass('hide-actions')
|
||||||
} else {
|
} else {
|
||||||
$(tlide + ' [toot-id=' + id + ']').removeClass('hide-actions')
|
$(tlide + ' [unique-id=' + id + ']').removeClass('hide-actions')
|
||||||
}
|
}
|
||||||
|
|
||||||
//$(tlide + " [toot-id=" + id + "] .area-vis").toggleClass("hide")
|
//$(tlide + " [toot-id=" + id + "] .area-vis").toggleClass("hide")
|
||||||
|
|
|
@ -1032,8 +1032,8 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
|
||||||
'unix'
|
'unix'
|
||||||
)}"
|
)}"
|
||||||
${if_notf}
|
${if_notf}
|
||||||
onmouseover="mov('${toot.id}','${tlid}','mv')"
|
onmouseover="mov('${uniqueid}','${tlid}','mv')"
|
||||||
onclick="mov('${toot.id}','${tlid}','cl')"
|
onclick="mov('${uniqueid}','${tlid}','cl')"
|
||||||
onmouseout="resetmv('mv')"
|
onmouseout="resetmv('mv')"
|
||||||
>
|
>
|
||||||
<div class="area-notice grid"><span class="gray sharesta">${notice}${home}</span></div>
|
<div class="area-notice grid"><span class="gray sharesta">${notice}${home}</span></div>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user