Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F22993634
D13955.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D13955.diff
View Options
Index: code/www/js/msite/modules/module_helpcentre.js
===================================================================
--- code/www/js/msite/modules/module_helpcentre.js
+++ code/www/js/msite/modules/module_helpcentre.js
@@ -85,12 +85,13 @@
/****Module to get Faq's for a particular catalogue****/
FKM.module.define("fkGetSubCategory", ["Zepto", "fkAjax"], function ($, fkAjax) {
"use strict";
-
- var currentExpandedLinkEl = null;
+ var currentExpandedLinkEl = null,
+ subCategoryEl = [];
function getSubCategory(linkObj) {
var category = linkObj.data("id");
var categoryEl = $("#browse-category");
+
if($.trim(category) != "") {
fkAjax.doAjax({
url: '/lc/m/helpcentre-subCategory/spotList1/spot1/subCategory',
@@ -100,14 +101,22 @@
type: "GET",
dataType: "html",
cache: false,
+ beforeSend:function(){
+ FKM.PB.trigger("module:overlay:startblockingloader",{index:1000});
+ },
success: function(response) {
- linkObj.addClass('active-head');
+ linkObj.addClass('active-head').addClass('visited');
+
var tableEl = getTabelElForLink(linkObj);
- tableEl.after(response);
+ tableEl.after($(response).attr('id',"sc"+category));
+
+ subCategoryEl.push("sc"+category);
currentExpandedLinkEl = linkObj;
},
error: function(response) {
-
+ },
+ complete : function(){
+ FKM.PB.trigger("module:overlay:endblockingloader");
}
});
}
@@ -181,24 +190,57 @@
function init(context){
log("FUNCTION:fkGetSubCategory:init");
var categoryEl = $(".browse-category");
+
categoryEl.delegate("a.link", 'click' ,function() {
- var target = $(this), tableEl;
+ var target = $(this),
+ tableEl,
+ subCategoryLen = subCategoryEl.length,
+ currSubCategoryEl = null;
if(target.hasClass('notoggle')){
return;
}
+ if(target.hasClass('active-head')){
+ var ind = 0;
+ for(ind;ind < subCategoryLen;ind++){
+ currSubCategoryEl = subCategoryEl[ind];
+ $("#"+currSubCategoryEl).hide();
+ }
+
+ target.removeClass("active-head");
+
+ return;
+ }
+
+ if(target.hasClass('visited')){
+ var ind = 0;
+
+ for(ind;ind < subCategoryLen;ind++){
+
+ currSubCategoryEl = subCategoryEl[ind];
+
+ if(currSubCategoryEl == "sc"+target.attr('data-id')){
+ $("#"+currSubCategoryEl).show();
+ }else{
+ $("#"+currSubCategoryEl).hide();
+ }
+ }
+
+ $(categoryEl).find('a.link').removeClass('active-head');
+ target.addClass('active-head');
+
+ return;
+ }
+
if(!target.hasClass("active-head")) {
+
if(currentExpandedLinkEl){
currentExpandedLinkEl.removeClass('active-head');
tableEl = getTabelElForLink(currentExpandedLinkEl);
- tableEl.next('ul').remove();
+ tableEl.next('ul').hide();
}
- getSubCategory($(this));
- } else {
- tableEl = getTabelElForLink(target);
- tableEl.next("ul").remove();
- target.removeClass("active-head");
+ getSubCategory(target);
}
});
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 13, 1:08 AM (23 h, 49 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
17405294
Default Alt Text
D13955.diff (3 KB)
Attached To
Mode
D13955: Including overlay for helpcenter sub category requests.
Attached
Detach File
Event Timeline
Log In to Comment