1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 | define(['talent',"$.cookie"],function(Talent){
|
8 | var jst = (function(){
|
9 | this["JST"] = this["JST"] || {};
|
10 |
|
11 | this["JST"]["sidebar/bg-slider"] = function(obj) {obj || (obj = {});var __t, __p = '', __e = _.escape;with (obj) {__p += '';}return __p};
|
12 |
|
13 | this["JST"]["sidebar/multiple-menu-item"] = function(obj) {obj || (obj = {});var __t, __p = '', __e = _.escape, __j = Array.prototype.join;function print() { __p += __j.call(arguments, '') }with (obj) {__p += '<a\n\tclass="list-1st-a"\n\tindex="' +((__t = ( index)) == null ? '' : __t) +'"\n\tdata-udc="' +((__t = (encodeURIComponent(JSON.stringify({ext: JSON.stringify({type:'globalMenu', id: id, appid:appId })})))) == null ? '' : __t) +'"\n\thref="javascript:;"\n>\n\t<span\n\t\tclass="sd-icon-before ' +((__t = (iconName)) == null ? '' : __t) +' ' +((__t = (( !newCount?'':'sd-new-message'))) == null ? '' : __t) +' ' +((__t = (MenuPoint && MenuPoint.value?'sd-update-tip':'')) == null ? '' : __t) +'"\n\t>\n\t\t<span class="red-remind" data-name="feed-all-indicator"></span>\n\t\t<span class="new-tip" data-name="update-tip"></span>\n\t</span>\n <span class="text">' +((__t = (title)) == null ? '' : __t) +'</span>\n\t<span class="sd-icon-after"></span>\n</a>\n\n'; if(children.length){ ;__p += '\n<ul class="list-2sd-ul">\n\t'; Talent._.each(children,function(item,index){ ;__p += '\n\t<li>\n\t\t<a\n\t\t\tclass="list-2sd-li ' +((__t = ( 'ani-item-' + index )) == null ? '' : __t) +' ' +((__t = ( (item.type == 'iframe')?'is-iframe':'' )) == null ? '' : __t) +' ' +((__t = ((item.isActive?'bg-highlight':''))) == null ? '' : __t) +' "\n\t\t\thref=\'' +((__t = ((item.href == "" || item.href == "#" || item.type == "iframe") ? "javascript:;":(item.href))) == null ? '' : __t) +'\'\n\t\t\tindex="' +((__t = (index)) == null ? '' : __t) +'"\n\t\t\tdata-udc="' +((__t = (encodeURIComponent(JSON.stringify({ext: JSON.stringify({type:'globalMenu', id: item.id, appid:item.appId })})))) == null ? '' : __t) +'"\n\t\t\ttarget="' +((__t = ( (item.type=='intLink')?'_self':(item.type=='extLink'||item.type=='newPage'?'_blank':'') )) == null ? '' : __t) +'"\n\t\t\tdata-trigger="' +((__t = ( (item.type=='iframe')?false:'')) == null ? '' : __t) +'"\n\t\t>\n \n <span class="list-2sd-li-title">' +__e( item.title ) +'</span>\n\t\t\t<span\n\t\t\t\tclass=" ' +((__t = (item.MenuPoint && item.MenuPoint.value?'sd-update-tip':'')) == null ? '' : __t) +'"\n\t\t\t>\n\t\t\t\t<span\n\t\t\t\t\tclass="new-tip mult-new-tip"\n\t\t\t\t\tdata-name="update-tip"\n\t\t\t\t></span>\n\t\t\t</span>\n\t\t</a>\n\t</li>\n\t'; }) ;__p += '\n</ul>\n'; } ;__p += '\n';}return __p};
|
14 |
|
15 | this["JST"]["sidebar/narrow-list-extend"] = function(obj) {obj || (obj = {});var __t, __p = '', __e = _.escape, __j = Array.prototype.join;function print() { __p += __j.call(arguments, '') }with (obj) {__p += '<ul class="list-narrow-wrapper">\n ';Talent._.each(menuArry,function(item,superindex){;__p += '\n <li class="list-1st2-li ' +((__t = ( ('sp-item-' +superindex) )) == null ? '' : __t) +' ' +((__t = ( (item.children&&item.children.length)?'has-sub-list':'no-sub-list' )) == null ? '' : __t) +' ' +((__t = (item.isQuickEntry?'quick-entry-extend':'')) == null ? '' : __t) +'">\n <a \n class="list-1st2-a ' +((__t = ( (item.type == 'iframe')?'is-iframe':'' )) == null ? '' : __t) +' ' +((__t = ((item.isActive?'shadow-bg':''))) == null ? '' : __t) +'" \n href=\'' +((__t = ((item.href == "" || item.href == "#" || item.type == "iframe")?"javascript:void(0)":(item.href))) == null ? '' : __t) +'\' \n index="' +((__t = ( superindex)) == null ? '' : __t) +'"\n isSuperItem="true"\n data-udc="' +((__t = (encodeURIComponent(JSON.stringify({ext: JSON.stringify({type:'globalMenu', id: item.id, appid:item.appId })})))) == null ? '' : __t) +'" \n data-trigger="' +((__t = ( (item.type=='iframe')?false:'')) == null ? '' : __t) +'">\n <span>' +((__t = (item.title)) == null ? '' : __t) +'</span>\n <span class="sd-icon-after" ></span>\n </a>\n '; if(item.children&&item.children.length){ ;__p += '\n <ul class="list-2sd2-ul top-position">\n ';Talent._.each(item.children,function(subItem,subIndex){;__p += '\n <li class="list-2sd2-li ' +((__t = ( 'ani-index-' + subIndex )) == null ? '' : __t) +' ' +((__t = ((subItem.isActive?'shadow-bg':''))) == null ? '' : __t) +'">\n <a \n href=\'' +((__t = ((subItem.href =="" || subItem.href =="#" || subItem.type == "iframe")?"javascript:void(0)":subItem.href)) == null ? '' : __t) +'\'\n class="shadow-list-a ' +((__t = ( (subItem.type == 'iframe')?'is-iframe':'' )) == null ? '' : __t) +'" \n super-name="' +((__t = ( item.code)) == null ? '' : __t) +'"\n sub-name="' +((__t = ( subItem.code)) == null ? '' : __t) +'"\n super-index="' +((__t = ( superindex)) == null ? '' : __t) +'"\n sub-index="' +((__t = ( subIndex)) == null ? '' : __t) +'"\n target= "' +((__t = ( (subItem.type=='intLink')?'_self':(subItem.type=='extLink' || subItem.type=='newPage'?'_blank':'') )) == null ? '' : __t) +'"\n data-udc="' +((__t = (encodeURIComponent(JSON.stringify({ext: JSON.stringify({type:'globalMenu', id: subItem.id, appid:subItem.appId })})))) == null ? '' : __t) +'" \n data-trigger="' +((__t = ( (subItem.type=='iframe')?false:'')) == null ? '' : __t) +'">\n ' +((__t = (subItem.title)) == null ? '' : __t) +'\n </a>\n </li>\n '; }) ;__p += '\n </ul>\n '; } ;__p += '\n </li>\n ';});__p += '\n</ul>\n';}return __p};
|
16 |
|
17 | this["JST"]["sidebar/side-bar"] = function(obj) {obj || (obj = {});var __t, __p = '', __e = _.escape, __j = Array.prototype.join;function print() { __p += __j.call(arguments, '') }with (obj) {__p += '<div class="status-switch-wrapper">\n <span class="status-switch" data-name="switch">\n <span class="line-1"></span>\n <span class="line-2"></span>\n <span class="line-3"></span>\n </span>\n</div>\n<div data-name=\'top-shadow\' class="shadow-node-top"></div>\n<div class="list-outer-wrapper">\n <ul class="list-1st-ul">\n \t<div class="bg-slider-region"></div>\n </ul>\n</div>\n<div class="list-narrow-extend"></div>\n<div data-name=\'bottom-shadow\' class="shadow-node-bottom"></div>\n'; if(isLookingForService || isWantTucao){ ;__p += '\n <div class="tucao-service-container tucao-service-spread-layout">\n '; if(isLookingForService){ ;__p += '\n <div class="looking-for-service ' +((__t = ( !isWantTucao ? 'onlyone':'')) == null ? '' : __t) +'" data-name="looking-for-service">\n <span class="icon sys-icon-kefu" >\n </span>\n <span class="service-text" >' +((__t = ( !isWantTucao ? '在线客服':'找客服')) == null ? '' : __t) +'</span>\n </div>\n '; } ;__p += '\n\n '; if(isLookingForService && isWantTucao){ ;__p += '\n <div class="border"></div>\n '; } ;__p += '\n\n '; if(isWantTucao){ ;__p += '\n <div class="want-tucao ' +((__t = ( !isLookingForService ? 'onlyone':'')) == null ? '' : __t) +'" data-name="want-tucao">\n <span class="icon sys-icon-tucao" >\n </span>\n <span class="tucao-text" > ' +((__t = ( !isLookingForService ? '我要吐槽':'要吐槽')) == null ? '' : __t) +'</span>\n </div>\n '; } ;__p += '\n </div>\n <div class="tucao-service-container tucao-service-norrow-layout ' +((__t = ( isLookingForService && !isWantTucao ? 'looking-for-service-narrow' : '')) == null ? '' : __t) +'">\n <span class="norrow-icon ' +((__t = ( narrowIcon )) == null ? '' : __t) +'" ></span>\n <div class="tucao-service-list">\n '; if(isLookingForService && isWantTucao){ ;__p += '\n <div class="norrow-border"></div>\n '; } ;__p += '\n '; if(isLookingForService){ ;__p += '\n <div class="tucao-service-item looking-for-service-narrow" style="background-color: ' +((__t = ( !isWantTucao ? 'rgba(0,0,0,0.10)' : '')) == null ? '' : __t) +'" data-name="looking-for-service">' +((__t = ( !isWantTucao ? '在线客服':'找客服')) == null ? '' : __t) +'</div>\n '; } ;__p += '\n '; if(isWantTucao){ ;__p += '\n <div class="tucao-service-item" style="background-color: ' +((__t = ( !isLookingForService ? 'rgba(0,0,0,0.10)' : '')) == null ? '' : __t) +'" data-name="want-tucao">' +((__t = ( !isLookingForService ? '我要吐槽':'要吐槽')) == null ? '' : __t) +'</div>\n '; } ;__p += '\n </div>\n </div>\n\n'; } ;}return __p};
|
18 |
|
19 | this["JST"]["sidebar/single-menu-item"] = function(obj) {obj || (obj = {});var __t, __p = '', __e = _.escape;with (obj) {__p += '\n<a class="list-1st-a ' +((__t = ( isActive?'bg-highlight':'' )) == null ? '' : __t) +' ' +((__t = ( (type=='iframe')?'is-iframe':'' )) == null ? '' : __t) +'"\n data-udc="' +((__t = (encodeURIComponent(JSON.stringify({ext: JSON.stringify({type:'globalMenu', id: id, appid:appId })})))) == null ? '' : __t) +'"\n\thref=\'' +((__t = ((href == "" || href == "#" || type == "iframe" || type == "newPage" || type == "extLink") ? "javascript:;":(href))) == null ? '' : __t) +'\'\n\tindex="' +((__t = ( index)) == null ? '' : __t) +'"\n\ttarget= "' +((__t = ( (type=='intLink')?'_self':(type=='extLink' || type=='newPage'?'_blank':''))) == null ? '' : __t) +'"\n data-trigger="' +((__t = ( (type=='iframe')?false:'')) == null ? '' : __t) +'">\n <span class="sd-icon-before ' +((__t = (iconName)) == null ? '' : __t) +' ' +((__t = ((newCount?'sd-new-message':'') )) == null ? '' : __t) +' ' +((__t = (MenuPoint && MenuPoint.value?'sd-update-tip':'')) == null ? '' : __t) +' " >\n <span class="red-remind" data-name="feed-all-indicator" ></span>\n <span class="new-tip" data-name="update-tip" ></span>\n </span>\n <span class="text" data-id="' +((__t = (appId)) == null ? '' : __t) +'">' +((__t = (title)) == null ? '' : __t) +'</span>\n\n</a>';}return __p};
|
20 | return this["JST"];
|
21 | })();
|
22 | var SingleItem = Talent.ItemView.extend({
|
23 | template: jst["sidebar/single-menu-item"],
|
24 | className: "",
|
25 | initialize: function(options) {
|
26 | this.model = new Talent.Model(options);
|
27 | this.model.set({
|
28 | maxWidth: 0,
|
29 | });
|
30 | this.listenTo(this.model, "change", this.render)
|
31 | this.Viewindex = options.index
|
32 | },
|
33 | ui: {
|
34 | memuItem: ".list-1st-a",
|
35 | },
|
36 | events: function() {
|
37 | var events = {}
|
38 | events["click " + this.ui.memuItem] = "menuItemClick"
|
39 | events["mouseenter " + this.ui.memuItem] = "itemMouseEnter"
|
40 | events["mouseleave " + this.ui.memuItem] = "itemMouseLeave"
|
41 | return events
|
42 | },
|
43 |
|
44 | menuItemClick: function(e) {
|
45 | this.trigger("getLayout");
|
46 |
|
47 |
|
48 |
|
49 |
|
50 |
|
51 |
|
52 | this.model.set({ newCount: false })
|
53 | this.model.set({ MenuPoint: false })
|
54 | },
|
55 | clickType: function(isNarrowLayout) {
|
56 | if (isNarrowLayout) {
|
57 | this.trigger("pseudoClick", this.model.toJSON())
|
58 | } else {
|
59 | this.trigger("itemClick", this.model.toJSON())
|
60 | }
|
61 | },
|
62 |
|
63 | highlightCancle: function(htInfo) {
|
64 |
|
65 | this.model.set({ isActive: false })
|
66 | },
|
67 |
|
68 | highlightAdd: function() {
|
69 |
|
70 | this.model.set({ isActive: true })
|
71 | },
|
72 |
|
73 | itemMouseEnter: function() {
|
74 |
|
75 | this.triggerData("addClass")
|
76 | },
|
77 |
|
78 | itemMouseLeave: function() {
|
79 | this.triggerData("removeClass")
|
80 | },
|
81 | triggerData: function(classOpr) {
|
82 |
|
83 | var data = {
|
84 | id: this.model.get("id"),
|
85 | index: this.model.get("index"),
|
86 | isActive: this.model.get("isActive"),
|
87 | classOpr: classOpr,
|
88 | };
|
89 |
|
90 | this.trigger("mouse-enter-leave", data)
|
91 | },
|
92 |
|
93 | itemReload: function(newData) {
|
94 |
|
95 | newData.isActive = newData.isActive ? true : false
|
96 | newData.newCount = newData.newCount ? true : false
|
97 | newData.index = this.Viewindex
|
98 | newData.isActive = this.isActive;
|
99 |
|
100 | this.model.clear({ silent: true }).set(newData)
|
101 | },
|
102 | setMsgNotice: function(resp) {
|
103 | this.model.set({ newCount: resp })
|
104 | },
|
105 | })
|
106 |
|
107 | var MultipleItem = Talent.Layout.extend({
|
108 | template: jst["sidebar/multiple-menu-item"],
|
109 | className: "has-sub-list",
|
110 | initialize: function(options) {
|
111 | this.options = options
|
112 | this.viewIndex = options.index
|
113 | this.model = new Talent.Model(options)
|
114 | this.listenTo(this.model, "change", this.render)
|
115 |
|
116 | this.isSubNav = true
|
117 |
|
118 | this.listIsOpen = false
|
119 |
|
120 | this.subListHeight = 34 * this.options.children.length
|
121 |
|
122 | },
|
123 | ui: {
|
124 | menuItem: ".list-1st-a",
|
125 | subItem: ".list-2sd-li",
|
126 | listWrap: ".list-2sd-ul",
|
127 | },
|
128 | events: function() {
|
129 | var events = {}
|
130 | events["click " + this.ui.subItem] = "subNavClick"
|
131 | events["click " + this.ui.menuItem] = "listSwitch"
|
132 | events["mouseenter " + this.ui.menuItem] = "superItemEnter"
|
133 | events["mouseleave " + this.ui.menuItem] = "superItemLeave"
|
134 | return events
|
135 | },
|
136 | onShow: function() {
|
137 |
|
138 | if (this.model.get("isQuickEntry")) {
|
139 | this.$el.addClass("open quick-entry")
|
140 | }
|
141 | },
|
142 |
|
143 | listSwitch: function(flag) {
|
144 |
|
145 |
|
146 | if (this.model.get("isQuickEntry")) return
|
147 |
|
148 | if (flag && flag.isFromQuickEntry) {
|
149 | var self = this
|
150 | if (!this.listIsOpen) {
|
151 | this.superMenuHighlightSwitch(true)
|
152 | }
|
153 | var heightGap = flag.p.cIndex >= 0 ? flag.p.cIndex * 34 + 44 : 0
|
154 | var positionY = self.$el.position().top
|
155 | self.trigger("listSwitch", {
|
156 | top: positionY,
|
157 | subListHeight: heightGap,
|
158 | isOpen: self.listIsOpen,
|
159 | target: self,
|
160 | isFromQuickEntry: flag && flag.isFromQuickEntry ? true : false,
|
161 | })
|
162 | } else {
|
163 | this.listIsOpen = !this.listIsOpen;
|
164 |
|
165 |
|
166 | this.$el.toggleClass("open");
|
167 |
|
168 | this.superMenuHighlightSwitch()
|
169 | var highlightChildNode = this.ui.listWrap.find(".bg-highlight")
|
170 | var heightGap = highlightChildNode.length
|
171 | ? (parseInt(highlightChildNode.attr("index")) + 1) * 34
|
172 | : this.subListHeight;
|
173 |
|
174 | var positionY = this.$el.position().top
|
175 | this.trigger("listSwitch", {
|
176 | top: positionY,
|
177 | subListHeight: heightGap,
|
178 | isOpen: this.listIsOpen,
|
179 | target: this,
|
180 | isFromQuickEntry: flag && flag.isFromQuickEntry ? true : false,
|
181 | })
|
182 | }
|
183 | },
|
184 |
|
185 | subNavClick: function(e) {
|
186 | var subIndex = Talent.$(e.currentTarget).attr("index"),
|
187 | model = this.model.toJSON().children[subIndex];
|
188 |
|
189 |
|
190 | this.trigger("itemClick", model)
|
191 | this._setMenuPoint(subIndex)
|
192 | },
|
193 |
|
194 | simSubNavClick: function(index) {
|
195 | var firstDom = this.$el
|
196 | .find(".list-2sd-ul")
|
197 | .children()
|
198 | .eq(index)
|
199 | .children()
|
200 | firstDom.click()
|
201 | },
|
202 | _setMenuPoint: function(subIndex) {
|
203 | var model = this.model.get("children")[subIndex]
|
204 | if (model.MenuPoint && model.MenuPoint.value == false) {
|
205 | return
|
206 | }
|
207 | model.MenuPoint && (model.MenuPoint.value = false)
|
208 | this.model.set({ MenuPoint: false })
|
209 | },
|
210 |
|
211 | superMenuHighlightSwitch: function(flag) {
|
212 |
|
213 | if (flag) {
|
214 | var self = this;
|
215 |
|
216 | setTimeout(function() {
|
217 | self.ui.menuItem.addClass("bg-highlight")
|
218 | }, 300)
|
219 | } else {
|
220 |
|
221 | var isHasHighLightChild = this.ui.listWrap.find(".bg-highlight")
|
222 | .length
|
223 | this.ui.menuItem[isHasHighLightChild ? "addClass" : "removeClass"](
|
224 | "bg-highlight"
|
225 | )
|
226 | }
|
227 | },
|
228 |
|
229 | superItemEnter: function(e) {
|
230 | this.dataTrigger("addClass")
|
231 | },
|
232 |
|
233 | superItemLeave: function() {
|
234 | this.dataTrigger("removeClass")
|
235 | },
|
236 | dataTrigger: function(classOpr) {
|
237 |
|
238 | var data = {
|
239 | id: this.model.get("id"),
|
240 | index: this.model.get("index"),
|
241 | isActive: this.ui.menuItem.hasClass("bg-highlight"),
|
242 | classOpr: classOpr,
|
243 | }
|
244 | this.trigger("mouse-enter-leave", data)
|
245 | },
|
246 |
|
247 | listClose: function() {
|
248 | this.listIsOpen = false
|
249 | this.$el.removeClass("open")
|
250 | this.superMenuHighlightSwitch()
|
251 | var highlightChildNode = this.ui.listWrap.find(".bg-highlight")
|
252 | var heightGap = highlightChildNode.length
|
253 | ? (parseInt(highlightChildNode.attr("index")) + 1) * 34
|
254 | : this.subListHeight
|
255 | var positionY = this.$el.position().top
|
256 | this.trigger("listSwitch", {
|
257 | top: positionY,
|
258 | subListHeight: heightGap,
|
259 | isOpen: this.listIsOpen,
|
260 | target: this,
|
261 | })
|
262 | },
|
263 |
|
264 | itemReload: function(newData) {
|
265 | newData.isActive = newData.isActive ? true : false
|
266 | newData.newCount = newData.newCount ? true : false
|
267 | newData.index = this.viewIndex
|
268 | this.model.clear({ silent: true }).set(newData)
|
269 | },
|
270 |
|
271 | highlightReset: function(p) {
|
272 | this.dataArrange({})
|
273 | },
|
274 |
|
275 | highlightAdd: function(p) {
|
276 |
|
277 |
|
278 | this.ui.listWrap.find(".ani-item-" + p.cIndex).addClass("bg-highlight")
|
279 | var children = this.model.get("children") || []
|
280 | if (this.model.get("children")) {
|
281 | this.$el.addClass("open");
|
282 | this.$el.find('.list-1st-a').addClass('bg-highlight');
|
283 | }
|
284 | },
|
285 | highlightCancle: function(p) {
|
286 | this.$el.find(".bg-highlight").removeClass("bg-highlight")
|
287 | },
|
288 |
|
289 | dataArrange: function(subItem) {
|
290 |
|
291 | var newModel = JSON.parse(JSON.stringify(this.model.toJSON()))
|
292 | Talent._.each(newModel.children, function(item, index) {
|
293 | item.isActive = item.id == subItem.id ? true : false
|
294 | })
|
295 | this.itemReload(newModel)
|
296 | },
|
297 | })
|
298 |
|
299 | var BgSlider = Talent.Layout.extend({
|
300 | template: jst['sidebar/bg-slider']
|
301 | ,className : 'bg-slider silder-hidden'
|
302 | ,initialize:function(options){
|
303 | this.positionY = 0;
|
304 | }
|
305 | |
306 |
|
307 |
|
308 | ,sliderAni:function(newStyle){
|
309 | var self = this;
|
310 | this.$el.removeClass("silder-hidden");
|
311 | this.sliderGo(newStyle);
|
312 |
|
313 | setTimeout(function(){
|
314 | self.trigger('aniFinish');
|
315 | self.$el.addClass("silder-hidden");
|
316 | },300);
|
317 | }
|
318 | |
319 |
|
320 |
|
321 |
|
322 |
|
323 | ,positionResetSlice:function(newStyle){
|
324 | this.sliderGo(newStyle);
|
325 | }
|
326 |
|
327 | ,sliderGo:function(style){
|
328 | this.positionY = style.top;
|
329 | this.height = style.height;
|
330 |
|
331 | var transformSupportTest = this.transitionSupport()("transform");
|
332 | var transitionSupportTest = this.transitionSupport()("transition");
|
333 |
|
334 | if(transformSupportTest.isSupport && transitionSupportTest.isSupport){
|
335 |
|
336 | this.transformGo(style,transformSupportTest.props);
|
337 | }else{
|
338 | this.topGo(style);
|
339 | }
|
340 | }
|
341 |
|
342 | ,transformGo:function(style,prop){
|
343 | var cssStyle = {};
|
344 | cssStyle[prop] = 'translate3d(0,'+style.top+'px,0)';
|
345 | cssStyle.height = style.height;
|
346 | this.$el.css(cssStyle);
|
347 | }
|
348 |
|
349 | ,topGo:function(style){
|
350 | this.$el.css({top:style.top,'height':style.height});
|
351 | }
|
352 |
|
353 | ,transitionSupport:function(){
|
354 | var div = document.createElement('div'),
|
355 | vendors = 'Khtml Ms O Moz Webkit'.split(' '),
|
356 | len = vendors.length;
|
357 |
|
358 | return function(prop) {
|
359 | if ( prop in div.style ) return {isSupport:true,props:prop};
|
360 |
|
361 | prop = prop.replace(/^[a-z]/, function(val) {
|
362 | return val.toUpperCase();
|
363 | });
|
364 | while(len--) {
|
365 | if ( vendors[len] + prop in div.style ) {
|
366 |
|
367 |
|
368 | return {isSupport:true,props:vendors[len] + prop};
|
369 | }
|
370 | }
|
371 | return false;
|
372 | };
|
373 | }
|
374 | });
|
375 |
|
376 |
|
377 |
|
378 |
|
379 |
|
380 |
|
381 |
|
382 |
|
383 |
|
384 | var NarrowListExtend = Talent.Layout.extend({
|
385 | template: jst['sidebar/narrow-list-extend']
|
386 | ,className : 'list-narrow-outer'
|
387 | ,initialize:function(options){
|
388 | this.options = options;
|
389 | this.model = new Talent.Model(options);
|
390 | this.listenTo(this.model,'change',this.render);
|
391 |
|
392 | this.preHLT = null;
|
393 | }
|
394 | ,ui: {
|
395 | superLi:".no-sub-list .list-1st2-a"
|
396 | ,subItem:".shadow-list-a"
|
397 | ,listItem:".list-1st2-li"
|
398 | ,ListWrap:".list-narrow-wrapper"
|
399 | }
|
400 | ,events: function () {
|
401 | var events = {};
|
402 | events['click ' + this.ui.superLi] = "superItemClick";
|
403 | events['click ' + this.ui.subItem] = "subListClick";
|
404 | events['mouseenter ' + this.ui.listItem] = 'showSpread';
|
405 | events['mouseleave ' + this.ui.listItem] = 'hideSpread';
|
406 | return events;
|
407 | }
|
408 | ,onShow:function(){
|
409 |
|
410 | if (this.model.get('isQuickEntry')){
|
411 | this.$el.addClass('quick-entry')
|
412 | }
|
413 |
|
414 | }
|
415 | ,showSpread:function(e){
|
416 | var parentNode = $(e.target).parents(".list-1st2-li");
|
417 | parentNode.addClass("list-spread");
|
418 | }
|
419 | ,hideSpread:function(e){
|
420 | $(e.target).parents(".list-1st2-li").removeClass("list-spread");
|
421 | }
|
422 |
|
423 | ,superItemClick:function(e){
|
424 | var self = this,
|
425 | highlightNode = $(e.target).parent();
|
426 | highlightNode.removeClass("bg-ripple").addClass("bg-ripple");
|
427 | this.$el.find(".shadow-bg").removeClass("shadow-bg");
|
428 | var index = $(e.currentTarget).attr('index');
|
429 | var itemInfo = self.options.menuArry[index];
|
430 |
|
431 | self.trigger('superItemActive',itemInfo);
|
432 | setTimeout(function(){
|
433 | highlightNode.removeClass("bg-ripple list-spread").addClass('shadow-bg');
|
434 | },450);
|
435 | }
|
436 |
|
437 | ,subListClick:function(e){
|
438 |
|
439 | var self = this;
|
440 |
|
441 |
|
442 | var curNode = $(e.target);
|
443 |
|
444 | this.$el.find(".shadow-bg").removeClass("shadow-bg");
|
445 | curNode.removeClass("bg-ripple").addClass("bg-ripple");
|
446 |
|
447 | var nodeSuperIndex = curNode.attr("super-index");
|
448 | var nodeSubIndex = curNode.attr("sub-index");
|
449 | var superNodeInfo = JSON.parse(JSON.stringify(this.model.toJSON())).menuArry[nodeSuperIndex];
|
450 | var triggerData = {
|
451 | superNodeInfo:superNodeInfo
|
452 | ,subNodeInfo:superNodeInfo.children[nodeSubIndex]
|
453 | }
|
454 | this.trigger("sublistActive",triggerData);
|
455 |
|
456 | setTimeout(function(){
|
457 | curNode.parents(".list-1st2-li").removeClass("list-spread");
|
458 | },450);
|
459 | }
|
460 |
|
461 | ,itemSpreade:function(resp){
|
462 |
|
463 | var oprNode = this.$el.find(".sp-item-"+resp.index);
|
464 | oprNode[resp.classOpr]("list-spread");
|
465 | this.$el[resp.classOpr]("extend");
|
466 | this.subListOpen(oprNode,resp);
|
467 | }
|
468 |
|
469 | ,setScrollTop:function(top){
|
470 | this.ui.ListWrap.css("top",-top);
|
471 | this.positionTop = top;
|
472 | }
|
473 |
|
474 | ,subListOpen:function(node,resp){
|
475 | var ulNode = node.find('.list-2sd2-ul');
|
476 |
|
477 | ulNode.removeClass("bottom-position").addClass("top-position");
|
478 |
|
479 | var itemPosition = node.offset().top;
|
480 |
|
481 |
|
482 |
|
483 |
|
484 |
|
485 | var windowH = $(window).height();
|
486 |
|
487 | var heightGap = windowH - itemPosition - 50;
|
488 | var sublistHeight = this.options.menuArry[parseInt(resp.index)].children.length * 40;
|
489 | if ((heightGap-sublistHeight)>20) {
|
490 | return;
|
491 | }
|
492 | ulNode.addClass("bottom-position").removeClass("top-position");
|
493 | }
|
494 |
|
495 | ,modelReset:function(p){
|
496 | var self = this;
|
497 | var currentModel = JSON.parse(JSON.stringify(this.model.toJSON()));
|
498 | Talent._.each(currentModel.menuArry,function(item,index){
|
499 | item.isActive = (item.id == p.fId)?true:false;
|
500 | Talent._.each(item.children,function(subItem,index){
|
501 | subItem.isActive = (subItem.id == p.cId)?true:false;
|
502 | subItem.isActive&&(item.isActive = true);
|
503 | });
|
504 | });
|
505 | setTimeout(function(){
|
506 | self.model.clear({silent:true}).set(currentModel);
|
507 | },700)
|
508 | }
|
509 |
|
510 | ,pseudoClick:function(node){
|
511 | this.$el.find(".sp-item-"+node.index).find(".list-1st2-a ").click();
|
512 | }
|
513 | ,onRender:function(){
|
514 |
|
515 | this.setScrollTop(this.positionTop);
|
516 | }
|
517 | });
|
518 |
|
519 | var SideBar = Talent.Layout.extend({
|
520 | template: jst['sidebar/side-bar'],
|
521 | className: 'page-sidebar-wrapper page-spread-layout',
|
522 | defaults: {
|
523 | menuArry: [],
|
524 | spreadWidth: 180,
|
525 | norrowWidth: 50,
|
526 | isLookingForService: false,
|
527 | isWantTucao: true,
|
528 | },
|
529 | initialize: function(options) {
|
530 | var narrowIcon;
|
531 | if (options.isLookingForService && options.isWantTucao) {
|
532 | narrowIcon = 'sys-icon-kefu-tucao';
|
533 | } else {
|
534 | narrowIcon = options.isWantTucao ? 'sys-icon-tucao' : 'sys-icon-kefu'
|
535 | }
|
536 | this.options = Talent._.extend({}, this.defaults, options, {narrowIcon: narrowIcon});
|
537 | this.model = new Talent.Model(this.options);
|
538 |
|
539 |
|
540 | this.isNarrowLayout = false
|
541 |
|
542 | this.preOpenList = null
|
543 |
|
544 | this.isFirstInit = true
|
545 |
|
546 | this.initLayout()
|
547 |
|
548 | this.isFirstLevel = false
|
549 | },
|
550 | regions: {
|
551 | bgSilderRegion: '.bg-slider-region',
|
552 | listNarrowExtend: '.list-narrow-extend'
|
553 | },
|
554 | ui: {
|
555 | layoutSwitchBtn: "[data-name='switch']",
|
556 | shadowTop: "[data-name='top-shadow']",
|
557 | shadowBottom: "[data-name='bottom-shadow']",
|
558 | itemWrapper: 'ul.list-1st-ul',
|
559 | btnWrap: '.status-switch-wrapper',
|
560 | lookingForService: "[data-name='looking-for-service']",
|
561 | wantTucao: "[data-name='want-tucao']",
|
562 | sideBarBottom:".tucao-service-container",
|
563 | tucaoIcon: '.sys-icon-tucao',
|
564 | kefuIcon: '.sys-icon-kefu',
|
565 | },
|
566 | events: function() {
|
567 | var events = {}
|
568 | events['click ' + this.ui.layoutSwitchBtn] = '_changeLayout'
|
569 | events['click ' + this.ui.wantTucao] = 'clickWantTucao'
|
570 | events['click ' + this.ui.lookingForService] = 'clickLookingForService'
|
571 | events['click ' + this.ui.tucaoIcon] = 'clickWantTucao'
|
572 | events['click ' + this.ui.kefuIcon] = 'clickLookingForService'
|
573 | return events
|
574 | },
|
575 | onRender: function() {
|
576 |
|
577 | this.bgSilder = new BgSlider()
|
578 | this.bgSilderRegion.show(this.bgSilder)
|
579 |
|
580 | this.narrowListExtend = new NarrowListExtend(this.options)
|
581 | this._listExtendListener()
|
582 | this.listNarrowExtend.show(this.narrowListExtend)
|
583 |
|
584 | this._baseViewCreate()
|
585 |
|
586 | this.triggerLayoutStatus()
|
587 |
|
588 | },
|
589 | onShow: function() {
|
590 | $('.page-sidebar-wrapper .list-1st-li').width(this.options.spreadWidth);
|
591 | if (this.options.spreadWidth === 220) {
|
592 | $('.page-sidebar-wrapper').addClass('large-sidebar');
|
593 | } else {
|
594 | $('.page-sidebar-wrapper').addClass('small-sidebar');
|
595 | }
|
596 |
|
597 |
|
598 |
|
599 |
|
600 |
|
601 |
|
602 |
|
603 |
|
604 |
|
605 |
|
606 |
|
607 | this._syncRoll()
|
608 | },
|
609 | _baseViewCreate: function(options) {
|
610 | var self = this
|
611 | Talent._.each(this.options.menuArry, function(item, index) {
|
612 |
|
613 | if (item.id !== undefined) {
|
614 |
|
615 | item.isActive = item.isActive ? true : false
|
616 | item.newCount = item.newCount ? true : false
|
617 | item.MenuPoint =
|
618 | typeof item.MenuPoint == 'object' ? item.MenuPoint : {}
|
619 | item.index = index
|
620 |
|
621 |
|
622 |
|
623 |
|
624 |
|
625 |
|
626 |
|
627 |
|
628 |
|
629 |
|
630 |
|
631 | var node = document.createElement('li')
|
632 |
|
633 | var itemViewName = 'menuItem' + item.id
|
634 | var regionName = itemViewName + '-region'
|
635 | var className = 'list-1st-li ' + regionName;
|
636 | if (item.children.length) {
|
637 | className += ' has-child';
|
638 | }
|
639 | $(node).addClass(className)
|
640 | self.ui.itemWrapper.append(node)
|
641 | self.addRegion(regionName, '.' + regionName)
|
642 | self[itemViewName] = item.children.length
|
643 | ? new MultipleItem(item)
|
644 | : new SingleItem(item)
|
645 |
|
646 | self.baseViewListener(self[itemViewName])
|
647 | self[regionName].show(self[itemViewName])
|
648 | }
|
649 | })
|
650 | },
|
651 | baseViewListener: function(baseView) {
|
652 | var self = this
|
653 | this.listenTo(baseView, 'itemClick', function(itemInfo) {
|
654 | window.localStorage.setItem('italent_active_appId', itemInfo.appId);
|
655 | window.localStorage.setItem('italent_active_appName', itemInfo.title);
|
656 | window.localStorage.setItem('italent_active_id', itemInfo.id);
|
657 |
|
658 | console.log(itemInfo.type)
|
659 | if (itemInfo.type == 'newPage' || itemInfo.type == 'extLink') {
|
660 |
|
661 |
|
662 |
|
663 | window.open(itemInfo.href)
|
664 | return
|
665 | }
|
666 |
|
667 | self.isFirstLevel = itemInfo.level == 1
|
668 | self._triggerHash(itemInfo)
|
669 |
|
670 | })
|
671 |
|
672 | this.listenTo(baseView, 'listSwitch', function(listInfo) {
|
673 | clearTimeout(self._timer)
|
674 |
|
675 | if (listInfo.isFromQuickEntry) {
|
676 | var subListHeight = listInfo.isOpen ? listInfo.subListHeight : 0
|
677 | var sliderHeight = listInfo.isOpen ? 34 : 44
|
678 | var newTop = listInfo.target.$el.position().top + subListHeight
|
679 | this.bgSilder.sliderAni({ top: newTop, height: sliderHeight })
|
680 | setTimeout(function() {
|
681 | self.bgSilder.positionResetSlice({
|
682 | top: newTop,
|
683 | height: sliderHeight
|
684 | })
|
685 | }, 300)
|
686 | } else {
|
687 |
|
688 | if (self.bgSilder.positionY >= listInfo.top) {
|
689 | var topAdd = listInfo.isOpen
|
690 | ? listInfo.subListHeight
|
691 | : -listInfo.subListHeight
|
692 | var newTop = self.bgSilder.positionY + topAdd
|
693 | self.bgSilder.positionResetSlice({
|
694 | top: newTop,
|
695 | height: self.bgSilder.height
|
696 | })
|
697 | }
|
698 |
|
699 | if (self.preOpenList && self.preOpenList != listInfo.target) {
|
700 | self.preOpenList.listClose()
|
701 | }
|
702 | }
|
703 |
|
704 |
|
705 |
|
706 | if (listInfo.isOpen) {
|
707 |
|
708 | var appid = listInfo.target.model.get('appId') || 0
|
709 |
|
710 |
|
711 | if (
|
712 | ((self.preOpenList &&
|
713 | self.preOpenList != listInfo.target) ||
|
714 | !self.preOpenList) &&
|
715 | (appid == 1020 || appid == 962)
|
716 | ) {
|
717 | self._timer = setTimeout(function() {
|
718 | baseView.simSubNavClick(0)
|
719 | }, 250)
|
720 | }
|
721 | }
|
722 |
|
723 | self.preOpenList = listInfo.target
|
724 | })
|
725 |
|
726 | this.listenTo(baseView, 'mouse-enter-leave', function(resp) {
|
727 | self.isNarrowLayout && self.narrowListExtend.itemSpreade(resp)
|
728 | })
|
729 |
|
730 | this.listenTo(baseView, 'getLayout', function() {
|
731 | baseView.clickType(self.isNarrowLayout)
|
732 | })
|
733 | this.listenTo(baseView, 'pseudoClick', function(node) {
|
734 | self.narrowListExtend.pseudoClick(node)
|
735 | })
|
736 | },
|
737 | _listExtendListener: function() {
|
738 |
|
739 | var self = this
|
740 | this.listenTo(this.narrowListExtend, 'superItemActive', function(
|
741 | simpleNavInfo
|
742 | ) {
|
743 |
|
744 | self._triggerHash(simpleNavInfo)
|
745 | })
|
746 | this.listenTo(this.narrowListExtend, 'sublistActive', function(p) {
|
747 |
|
748 | self._triggerHash(p.subNodeInfo)
|
749 | })
|
750 | },
|
751 |
|
752 | _changeLayout: function() {
|
753 | var norrowWidth = this.options.norrowWidth,
|
754 | spreadWidth = this.options.spreadWidth
|
755 | this.$el.width(!this.isNarrowLayout ? norrowWidth : spreadWidth)
|
756 | this.$el
|
757 | .toggleClass('page-spread-layout')
|
758 | .toggleClass('page-norrow-layout')
|
759 | this.isNarrowLayout = !this.isNarrowLayout
|
760 | this.triggerLayoutStatus()
|
761 | var newCk = this.isNarrowLayout ? 'narrow' : 'extend'
|
762 |
|
763 | this._createCookie('layoutStatus', newCk, 30);
|
764 |
|
765 | },
|
766 |
|
767 | _syncRoll: function() {
|
768 | var self = this
|
769 | Talent.$('.list-outer-wrapper').scroll(function(top) {
|
770 |
|
771 | self.narrowListExtend.setScrollTop(this.scrollTop)
|
772 |
|
773 | var shadowTopOpr = this.scrollTop > 10 ? 'addClass' : 'removeClass'
|
774 | self.ui.shadowTop[shadowTopOpr]('top-shadow')
|
775 | var shadowBottomOpr =
|
776 | this.scrollHeight - this.offsetHeight - this.scrollTop > 10
|
777 | ? 'addClass'
|
778 | : 'removeClass'
|
779 | self.ui.shadowBottom[shadowBottomOpr]('bottom-shadow')
|
780 | })
|
781 | var windowH = $(window).innerHeight() - 95 - 36
|
782 |
|
783 | if ($('.list-1st-ul').height() > windowH) {
|
784 | this.ui.shadowBottom.addClass('bottom-shadow')
|
785 | }
|
786 |
|
787 | var isAlwaysVisible = this.isOS() ? false : true
|
788 | var slimScroll = Talent.$('.list-outer-wrapper').slimScroll({
|
789 | height: windowH,
|
790 | color: '#000',
|
791 | opacity: 0.3,
|
792 | size: 6,
|
793 | distance: 2,
|
794 |
|
795 | alwaysVisible: true,
|
796 | railVisible: false,
|
797 | railColor: '#000',
|
798 | railOpacity: 0.1,
|
799 | allowPageScroll: false,
|
800 | position: 'right'
|
801 | })
|
802 | this.resetScrollArea()
|
803 | this.scrollEvent()
|
804 | },
|
805 | resetScrollArea: function() {
|
806 | var self = this
|
807 | $(window).on('resize', function() {
|
808 | windowH = window.innerHeight - 95 - 36
|
809 | Talent.$('.page-sidebar-wrapper .slimScrollDiv')
|
810 | .css({ height: windowH })
|
811 | .find('.list-outer-wrapper')
|
812 | .css({ height: windowH });
|
813 |
|
814 |
|
815 |
|
816 | Talent.$('.list-1st-a .text').hover();
|
817 | })
|
818 | },
|
819 | scrollEvent: function() {
|
820 | var slimScrollBar = $('.slimScrollBar')
|
821 | var slimScrollRail = $('.slimScrollRail')
|
822 | slimScrollBar.on('mouseenter', function() {
|
823 | slimScrollRail.css({ width: 12 })
|
824 | })
|
825 | slimScrollBar.on('mouseleave', function() {
|
826 | slimScrollRail.css({ width: 8 })
|
827 | })
|
828 | },
|
829 |
|
830 | initLayout: function() {
|
831 |
|
832 | var ck = this._getCookie('layoutStatus')
|
833 |
|
834 | if (ck == 'extend') {
|
835 | this.isNarrowLayout = false
|
836 | }
|
837 |
|
838 | else if (ck == 'narrow') {
|
839 | this.isNarrowLayout = true
|
840 | }
|
841 |
|
842 | else {
|
843 |
|
844 | this.isNarrowLayout = false
|
845 |
|
846 | var newCk = this.isNarrowLayout ? 'narrow' : 'extend'
|
847 |
|
848 | this._createCookie('layoutStatus', newCk, 30)
|
849 | }
|
850 |
|
851 | if (this.isNarrowLayout) {
|
852 | this.$el.width(this.options.norrowWidth)
|
853 | this.$el
|
854 | .removeClass('page-spread-layout')
|
855 | .addClass('page-norrow-layout');
|
856 |
|
857 |
|
858 |
|
859 |
|
860 |
|
861 | Talent.$('.page-sidebar-wrapper')
|
862 | .find('.tucao-service-container').addClass('norrow-layout');
|
863 | } else {
|
864 | this.$el.width(this.options.spreadWidth)
|
865 | }
|
866 | this.triggerLayoutStatus()
|
867 | },
|
868 |
|
869 | isOS: function() {
|
870 | var isOS = navigator.userAgent.indexOf('Mac', 0) != -1 ? true : false
|
871 | return isOS
|
872 | },
|
873 |
|
874 | _createCookie: function(name, value, days) {
|
875 | $.cookie(name, value, { expires: 30 })
|
876 | },
|
877 |
|
878 | _getCookie: function(c_name) {
|
879 | return $.cookie(c_name)
|
880 | },
|
881 |
|
882 | getWidth: function() {
|
883 | var narrowWidth = this.options.norrowWidth,
|
884 | spreadWidth = this.options.spreadWidth
|
885 | return { width: this.isNarrowLayout ? narrowWidth : spreadWidth }
|
886 | },
|
887 |
|
888 | triggerLayoutStatus: function() {
|
889 | var narrowWidth = this.options.norrowWidth,
|
890 | spreadWidth = this.options.spreadWidth
|
891 | this.trigger('layoutChanged', {
|
892 | width: this.isNarrowLayout ? narrowWidth : spreadWidth,
|
893 | isNarrowLayout: this.isNarrowLayout
|
894 | })
|
895 | },
|
896 |
|
897 | _triggerHash: function(hashData) {
|
898 |
|
899 | this.trigger('hashChanged', hashData)
|
900 | },
|
901 |
|
902 | menuItemReload: function(resp) {
|
903 |
|
904 | this['menuItem' + resp.id] &&
|
905 | this['menuItem' + resp.id].itemReload(resp)
|
906 |
|
907 | },
|
908 | setMsgNotice: function(resp) {
|
909 | var msgIndex
|
910 | if (resp.code) {
|
911 | Talent._.each(this.options.menuArry, function(item, index) {
|
912 | if (item.code == resp.code) {
|
913 | msgIndex = item.index
|
914 | }
|
915 | })
|
916 | } else {
|
917 | Talent._.each(this.options.menuArry, function(item, index) {
|
918 | if (item.id == resp.id) {
|
919 | msgIndex = item.index
|
920 | }
|
921 | })
|
922 | }
|
923 | this['menuItem' + this.options.menuArry[msgIndex].id].setMsgNotice(
|
924 | resp.newCount
|
925 | )
|
926 | },
|
927 | _getHLTIndex: function(resp) {
|
928 |
|
929 | var h = {
|
930 | fId: null,
|
931 | fIndex: null,
|
932 | cId: null,
|
933 | cIndex: null,
|
934 | isFromQuickEntry: resp.isQuickEntry ? true : false
|
935 | }
|
936 |
|
937 |
|
938 | var keyMatch = resp.code ? 'code' : 'id'
|
939 |
|
940 | return this.menuItemMatch(this.options.menuArry, resp, h, keyMatch)
|
941 | },
|
942 | menuItemMatch: function(array, flag, h, key) {
|
943 | Talent._.each(array, function(item, index) {
|
944 |
|
945 | if (!item.isQuickEntry) {
|
946 | if (item[key] == flag[key]) {
|
947 | h.fId = item.id
|
948 | h.fIndex = index
|
949 | } else {
|
950 | Talent._.each(item.children, function(subItem, subIndex) {
|
951 | if (subItem[key] == flag[key]) {
|
952 | h.fId = item.id
|
953 | h.fIndex = index
|
954 | h.cId = subItem.id
|
955 | h.cIndex = subIndex
|
956 | }
|
957 | })
|
958 | }
|
959 | }
|
960 | })
|
961 | return h
|
962 | },
|
963 | _goHighLight: function(p, resp) {
|
964 | var self = this
|
965 |
|
966 | this.preHTView && this.preHTView.highlightCancle(p)
|
967 |
|
968 | if (p.fIndex != null) {
|
969 |
|
970 |
|
971 | var curId = p.fId
|
972 |
|
973 | var curView = this['menuItem' + curId]
|
974 |
|
975 | if (curView) {
|
976 |
|
977 | var loadTm = this.isFirstInit ? 0 : 300
|
978 | var isSupportCss3 = this.bgSilder.transitionSupport()(
|
979 | 'transform'
|
980 | ).isSupport
|
981 | loadTm = isSupportCss3 ? loadTm : 0
|
982 | setTimeout(function() {
|
983 | curView.highlightAdd(p)
|
984 | }, loadTm)
|
985 | if (resp) {
|
986 | curView.listIsOpen = true
|
987 | }
|
988 |
|
989 | var h = p.cIndex == null || !curView.listIsOpen ? 44 : 34
|
990 | var subTop =
|
991 | p.cIndex == null || !curView.listIsOpen
|
992 | ? 0
|
993 | : p.cIndex * 34 + 44
|
994 | var top = curView.$el.position().top + subTop
|
995 |
|
996 | if (this.isFirstInit || this.isNarrowLayout) {
|
997 |
|
998 | if (p.isFromQuickEntry && p.cId) {
|
999 | curView.listSwitch({ isFromQuickEntry: true, p: p })
|
1000 | }
|
1001 | this.bgSilder.positionResetSlice({ top: top, height: h })
|
1002 | }
|
1003 |
|
1004 | else {
|
1005 |
|
1006 | if (p.isFromQuickEntry && p.cId) {
|
1007 | curView.listSwitch({ isFromQuickEntry: true, p: p })
|
1008 | } else {
|
1009 | this.bgSilder.sliderAni({ top: top, height: h })
|
1010 | }
|
1011 | }
|
1012 |
|
1013 | this.narrowListExtend.modelReset(p)
|
1014 | this.preHTView = curView
|
1015 | this.isFirstInit = false
|
1016 |
|
1017 | if (
|
1018 | curView.model.get('children') &&
|
1019 | curView.model.get('children').length
|
1020 | ) {
|
1021 | self.preOpenList = curView
|
1022 | }
|
1023 | }
|
1024 | }
|
1025 |
|
1026 | if (p.fIndex == null) {
|
1027 | this.bgSilder.positionResetSlice({ top: 0, height: 44 })
|
1028 | this.preHTView && this.preHTView.highlightCancle()
|
1029 | }
|
1030 | },
|
1031 |
|
1032 | highLightSet: function(resp) {
|
1033 |
|
1034 | if (resp != undefined) {
|
1035 | var pInfo = this._getHLTIndex(resp)
|
1036 | this._goHighLight(pInfo, resp)
|
1037 | }
|
1038 | },
|
1039 | isSimpleNav: function(p) {
|
1040 |
|
1041 |
|
1042 | },
|
1043 | clickWantTucao: function(e) {
|
1044 | e.stopPropagation();
|
1045 | console.log("clickWantTucao")
|
1046 | if (this.options.clickWantTucao) {
|
1047 | this.options.clickWantTucao()
|
1048 | }
|
1049 | },
|
1050 | clickLookingForService: function(e) {
|
1051 | e.stopPropagation();
|
1052 | console.log("clickLookingForService")
|
1053 | if (this.options.clickLookingForService) {
|
1054 | this.options.clickLookingForService()
|
1055 | }
|
1056 | }
|
1057 | })
|
1058 |
|
1059 | return SideBar;
|
1060 | })
|