solved desktop conflict during cherry pick
This commit is contained in:
1 parent
874819266d
commit
2d616ab7a8
9 files changed
+198
-36
No files matched your search
@@ -612,6 +612,7 @@ var orbitDesktop = function(dom){
|
||||
}
|
||||
}
|
||||
this.sub_menu_item = function(dom,data){
|
||||
console.log(dom)
|
||||
var sub_data_method = dom.attr('callback-method');
|
||||
if(sub_data_method){
|
||||
o.lastlink = dom.attr("href");
|
||||
@@ -818,7 +819,8 @@ var orbitDesktop = function(dom){
|
||||
};
|
||||
|
||||
this.initializeAppManager = function(target,url,cache){ //this is application search ie is app manager initialization
|
||||
var searchArray,allApps;
|
||||
var searchArray, allApps;
|
||||
|
||||
var bindHandlers = function(){ // bind handler for app manager page
|
||||
// var gn = $('.g_col').length,
|
||||
// gw = $('.g_col').outerWidth(true);
|
||||
@@ -826,7 +828,12 @@ var orbitDesktop = function(dom){
|
||||
// $("div#app_manager .group_search").css("width",$(window).width()-200);
|
||||
//for textbox search
|
||||
var $elements = $("#app_manager .element"),
|
||||
$result = $("#app_manager .search_result");
|
||||
$result = $("#app_manager .search_result"),
|
||||
$appinfo = $("#app_info"),
|
||||
$apptitle = $("#app_info .app_info_name"),
|
||||
$appicon = $("#app_info .app_info_icon")
|
||||
$appinfolist = $("#app_info .app_info_list");
|
||||
|
||||
$("#app_manager #searchbox")
|
||||
.focus(function(){
|
||||
$(this).val("");
|
||||
@@ -849,8 +856,8 @@ var orbitDesktop = function(dom){
|
||||
if(i == 1){
|
||||
$column = $('<div class="g_col g_col_w1"></div>');
|
||||
}
|
||||
var $newelement = $('<div class="element w1 h1 thmc2">'+$(this).html()+'</div>');
|
||||
$column.append($newelement);
|
||||
$column.append($(this));
|
||||
$(this).show();
|
||||
if(i == 4){
|
||||
$result.append($column);
|
||||
i = 0;
|
||||
@@ -859,6 +866,7 @@ var orbitDesktop = function(dom){
|
||||
if(i != 0){
|
||||
$result.append($column);
|
||||
}
|
||||
elementSetting();
|
||||
} else {
|
||||
$result.text("No Result Found.");
|
||||
}
|
||||
@@ -877,11 +885,11 @@ var orbitDesktop = function(dom){
|
||||
switch ($(this).attr("href")){
|
||||
case "ascending":
|
||||
$(this).attr("href","descending").find(".thmtxt").text("Alphabet [Z-A]");
|
||||
allApps = $("div#app_manager .group_search .element").sort(sortAscending);
|
||||
allApps = $("div#app_manager .element").sort(sortAscending);
|
||||
break;
|
||||
case "descending":
|
||||
$(this).attr("href","ascending").find(".thmtxt").text("Alphabet [A-Z]");
|
||||
allApps = $("#app_manager .group_search .element").sort(sortDescending);
|
||||
allApps = $("#app_manager .element").sort(sortDescending);
|
||||
break;
|
||||
}
|
||||
$("#app_manager #app_list").empty();
|
||||
@@ -897,25 +905,85 @@ var orbitDesktop = function(dom){
|
||||
$('.g_col.col'+ colindex).append(app);
|
||||
}
|
||||
});
|
||||
elementSetting();
|
||||
return false;
|
||||
});
|
||||
$(window).on('keydown', function(){
|
||||
if($('#searchbox').val() == 'Search'){
|
||||
$('#searchbox').focus();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
var elementSetting = function(){// for element setting load
|
||||
$(".element").click(function(){
|
||||
$e = $(this);
|
||||
$apptitle.text($e.data("title"));
|
||||
$appicon.attr("src",$e.find("img").attr("src"));
|
||||
$appinfolist.find("li:eq(2) div").text($e.data("version"));
|
||||
var dt = new Date($e.data("update"));
|
||||
$appinfolist.find("li:eq(3) div").text(dt.toUTCString());
|
||||
$appinfolist.find("li:eq(4) div").text($e.data("author"));
|
||||
|
||||
var sections = elementSettingsData[$e.data("id")].sections;
|
||||
|
||||
var sectionids = new Array();
|
||||
$.each(sections,function(i,sec){
|
||||
sectionids.push(sec.id);
|
||||
})
|
||||
|
||||
$appinfolist.find("li:eq(0)").empty();
|
||||
$.each(o.sectionList,function(i,sec){
|
||||
|
||||
var present = $.inArray(sec._id,sectionids);
|
||||
if(present == -1){
|
||||
$sectionswitch = $('<label class="s_grid s_grid_3">'+ sec.name +'</label><div class="s_grid s_grid_9 s_switch"><div class="s_switch_status" status-off="Off">Off</div><label class="s_switch_switcher admbg2"><input type="checkbox" data-widget="'+ $e.data("id") +'" data-section="'+ sec._id +'"><span class="s_switch_toggle"></span></label></div>');
|
||||
}else{
|
||||
$sectionswitch = $('<label class="s_grid s_grid_3">'+ sec.name +'</label><div class="s_grid s_grid_9 s_switch"><div class="s_switch_status" status-on="On">On</div><label class="s_switch_switcher thmc2"><input type="checkbox" checked="checked" data-widget="'+ $e.data("id") +'" data-section="'+ sec._id +'"><span class="s_switch_toggle"></span></label></div>');
|
||||
}
|
||||
$appinfolist.find("li:eq(0)").append($sectionswitch);
|
||||
})
|
||||
$appinfo.show();
|
||||
o.simple_switch(function(dom){
|
||||
var options = {
|
||||
"status" : dom.is(":checked"),
|
||||
"widget_id" : dom.data("widget"),
|
||||
"section_id" : dom.data("section")
|
||||
}
|
||||
var sectionDetails = o.sectionList.filter(function(o){return(o._id == dom.data("section"))})[0];
|
||||
$.ajax({
|
||||
url : "/desktop/appactivation",
|
||||
type : "post",
|
||||
datatype : "json",
|
||||
data : options,
|
||||
success : function(data){
|
||||
if(data.success == "true"){
|
||||
elementSettingsData[$e.data("id")].sections.push({"id" : dom.data("section"),"name":sectionDetails.name});
|
||||
if(dom.is(":checked"))
|
||||
o.notify("Added to " + sectionDetails.name,"success");
|
||||
else
|
||||
o.notify("Removed from " + sectionDetails.name,"success");
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
$appinfo.find("a.panel_close").click(function(){
|
||||
$appinfo.hide();
|
||||
return false;
|
||||
})
|
||||
elementSetting();
|
||||
o.appname_substr('#group_wrapper .element');
|
||||
o.simple_switch();
|
||||
|
||||
}
|
||||
var loadApps = function(){ //this load apps for sorting and searching
|
||||
$.getJSON("/desktop/getapplist",{desktopid:o.desktopId},function(appss){
|
||||
var elementSettingsData = {};
|
||||
var loadApps = function(){ //this load apps for sorting and searching
|
||||
$('#app_list').empty();
|
||||
$.getJSON("/desktop/getapplistforManager",{desktopid:o.desktopId},function(apps){
|
||||
var count = 0, colindex = 0;
|
||||
$('#app_list').append('<div class="g_col g_col_w1 col'+ colindex +'"/>');
|
||||
$.each(appss,function(i,apps){
|
||||
$.each(apps,function(i,app){
|
||||
var $app;
|
||||
count++;
|
||||
$app = $('<div class="element w1 h1 thmc2" data-category="'+app.data_category+'" data-content="'+app.data_content+'"><span class="tile thmc2"></span><a href="'+app._id+'" class="appicon"><img src="'+o.iconPath+app.data_content+'.png" alt="" onclick="return false;"></a><h1 class="appname thmtxt">'+app.title+'</h1></div>');
|
||||
elementSettingsData[app.id] = {"sections" : app.sections};
|
||||
$app = $('<div class="element w1 h1 hp vp thmc2" data-category="'+app.data_category+'" data-title="'+app.title+'" data-author="'+app.author+'" data-version="'+app.version+'" data-update="'+app.last_update+'" data-id="'+app.id+'" ><span class="tile thmc2"></span><a href="'+app.id+'" class="appicon"><img src="'+app.icon+'" alt="" onclick="return false;"></a><h1 class="appname thmtxt">'+app.title+'</h1></div>');
|
||||
if( count > 4 ){
|
||||
count = 1, colindex+=1;
|
||||
$('#app_list').append('<div class="g_col g_col_w1 col'+ colindex +'"/>');
|
||||
@@ -924,16 +992,14 @@ var orbitDesktop = function(dom){
|
||||
$('.g_col.col'+ colindex).append($app);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
bindHandlers();
|
||||
});
|
||||
}
|
||||
if(cache){
|
||||
bindHandlers();
|
||||
} else {
|
||||
// if(cache){
|
||||
// bindHandlers();
|
||||
// } else {
|
||||
loadApps();
|
||||
}
|
||||
// }
|
||||
};
|
||||
this.initializeSectionsManager = function(target,url,cache){ // this is init function for section manager
|
||||
var elementParent,element,slabel;
|
||||
@@ -1579,7 +1645,8 @@ var orbitDesktop = function(dom){
|
||||
});
|
||||
});
|
||||
};
|
||||
this.simple_switch = function(){
|
||||
|
||||
this.simple_switch = function(func){
|
||||
$('.s_switch').each(function(){
|
||||
var $switcher = $(this).find('.s_switch_switcher'),
|
||||
$checkbox = $(this).find('input[type=checkbox]'),
|
||||
@@ -1603,9 +1670,12 @@ var orbitDesktop = function(dom){
|
||||
$status.text(status_off);
|
||||
break;
|
||||
}
|
||||
if(typeof func == "function")
|
||||
func.call(this,$(this));
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
this.single_select = function(){
|
||||
// single select
|
||||
$('.ssl .ssl_item').each(function(){
|
||||
|
||||
Reference in new issue
Block a user