mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-30 17:58:39 +01:00
Highlight currently selected favorite
This commit is contained in:
parent
c41156c47c
commit
6537acb11f
@ -363,9 +363,17 @@ var AppJS = Class.extend(
|
|||||||
sidebox
|
sidebox
|
||||||
.off()
|
.off()
|
||||||
// removed .on("mouse(enter|leave)" (wrapping trash icon), as it stalls delete in IE11
|
// removed .on("mouse(enter|leave)" (wrapping trash icon), as it stalls delete in IE11
|
||||||
.on("click","div.ui-icon-trash", this, this.delete_favorite)
|
.on("click.sidebox","div.ui-icon-trash", this, this.delete_favorite)
|
||||||
// need to install a favorite handler, as we switch original one off with .off()
|
// need to install a favorite handler, as we switch original one off with .off()
|
||||||
.on('click','li[data-id]', this, function(event) {
|
.on('click.sidebox','li[data-id]', this, function(event) {
|
||||||
|
var li = $j(this);
|
||||||
|
li.siblings().removeClass('ui-state-highlight');
|
||||||
|
|
||||||
|
// Wait an arbitrary 50ms to avoid having the class removed again
|
||||||
|
// by the change handler.
|
||||||
|
window.setTimeout(function() {
|
||||||
|
li.addClass('ui-state-highlight');
|
||||||
|
},50);
|
||||||
var href = jQuery('a[href^="javascript:"]', this).prop('href');
|
var href = jQuery('a[href^="javascript:"]', this).prop('href');
|
||||||
var matches = href ? href.match(/^javascript:([^\(]+)\((.*)?\);?$/) : null;
|
var matches = href ? href.match(/^javascript:([^\(]+)\((.*)?\);?$/) : null;
|
||||||
if (matches && matches.length > 1 && matches[2] !== undefined)
|
if (matches && matches.length > 1 && matches[2] !== undefined)
|
||||||
@ -401,6 +409,18 @@ var AppJS = Class.extend(
|
|||||||
self._refresh_fav_nm();
|
self._refresh_fav_nm();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Bind favorite de-select
|
||||||
|
var egw_fw = egw_getFramework();
|
||||||
|
if(egw_fw && egw_fw.applications[this.appname] && egw_fw.applications[this.appname].browser
|
||||||
|
&& egw_fw.applications[this.appname].browser.baseDiv)
|
||||||
|
{
|
||||||
|
$j(egw_fw.applications[this.appname].browser.baseDiv)
|
||||||
|
.off('.sidebox')
|
||||||
|
.on('change.sidebox', function() {
|
||||||
|
$j('li',self.sidebox).removeClass('ui-state-highlight');
|
||||||
|
});
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -1139,6 +1139,15 @@
|
|||||||
background-size: 12px 12px;
|
background-size: 12px 12px;
|
||||||
background-position: 0 0;
|
background-position: 0 0;
|
||||||
}
|
}
|
||||||
|
.sidebox-favorites ul.favorites li.ui-menu-item.ui-state-highlight {
|
||||||
|
color: #000000;
|
||||||
|
background: #9b6ad6;
|
||||||
|
padding: 3px 0;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
.sidebox-favorites ul.favorites li.ui-menu-item.ui-state-highlight a {
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
.sidebox-favorites ul.favorites li:first-child a div.ui-icon-heart {
|
.sidebox-favorites ul.favorites li:first-child a div.ui-icon-heart {
|
||||||
background-image: url(../images/trash.png);
|
background-image: url(../images/trash.png);
|
||||||
background-size: 12px 12px;
|
background-size: 12px 12px;
|
||||||
|
@ -1128,6 +1128,15 @@
|
|||||||
background-size: 12px 12px;
|
background-size: 12px 12px;
|
||||||
background-position: 0 0;
|
background-position: 0 0;
|
||||||
}
|
}
|
||||||
|
.sidebox-favorites ul.favorites li.ui-menu-item.ui-state-highlight {
|
||||||
|
color: #000000;
|
||||||
|
background: #9b6ad6;
|
||||||
|
padding: 3px 0;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
.sidebox-favorites ul.favorites li.ui-menu-item.ui-state-highlight a {
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
.sidebox-favorites ul.favorites li:first-child a div.ui-icon-heart {
|
.sidebox-favorites ul.favorites li:first-child a div.ui-icon-heart {
|
||||||
background-image: url(../images/trash.png);
|
background-image: url(../images/trash.png);
|
||||||
background-size: 12px 12px;
|
background-size: 12px 12px;
|
||||||
|
@ -1045,7 +1045,15 @@ button#admin-categories-index_add {
|
|||||||
|
|
||||||
|
|
||||||
} // Ende li
|
} // Ende li
|
||||||
|
li.ui-menu-item.ui-state-highlight {
|
||||||
|
.color_100_gray;
|
||||||
|
background: @egw_color_3_e;
|
||||||
|
padding: 3px 0;
|
||||||
|
border: none;
|
||||||
|
|
||||||
|
a{color: @gray_0;}
|
||||||
|
|
||||||
|
}
|
||||||
// Filter aufheben
|
// Filter aufheben
|
||||||
li:first-child{
|
li:first-child{
|
||||||
a div.ui-icon-heart {background-image: url(../images/trash.png); background-size: 12px 12px;background-position: 0 0;}
|
a div.ui-icon-heart {background-image: url(../images/trash.png); background-size: 12px 12px;background-position: 0 0;}
|
||||||
|
Loading…
Reference in New Issue
Block a user