fix: CSS dragTrigger: multiple identical ID's on every page
This commit is contained in:
parent
547ced6500
commit
7042946bdf
4 changed files with 8 additions and 5 deletions
|
|
@ -10,7 +10,7 @@ div.dragable:hover {
|
|||
padding: 0px;
|
||||
margin: 0px;
|
||||
}
|
||||
#dragTrigger{
|
||||
.dragTriggerWrap{
|
||||
width: 100%;
|
||||
height: 18px;
|
||||
font-size: 10px;
|
||||
|
|
|
|||
|
|
@ -58,11 +58,12 @@ function dragable_checkKeyEvent(e) {
|
|||
|
||||
//goes up the parent tree until class is found. If not found, returns null
|
||||
function dragable_getObjectByClass(target,clazz) {
|
||||
while (target.tagName!=topelement&&target.className!=clazz){
|
||||
var classMatch = new RegExp("\\b" + clazz + "\\b");
|
||||
while (target.tagName!=topelement && target.className.search(classMatch) == -1){
|
||||
target=dom? target.parentNode : target.parentElement
|
||||
}
|
||||
|
||||
if (target.className==clazz){
|
||||
if (target.className.search(classMatch) != -1){
|
||||
return target;
|
||||
}else {
|
||||
return null;
|
||||
|
|
@ -202,7 +203,7 @@ function dragable_dragStart(e){
|
|||
e=dom? e : event;
|
||||
var fObj=dom? e.target : e.srcElement
|
||||
|
||||
if (fObj.className != "dragTrigger") {
|
||||
if (fObj.className.search(/\bdragTrigger\b/) == -1) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue