翻譯|使用教程|編輯:況魚(yú)杰|2019-11-21 14:51:08.460|閱讀 255 次
概述:默認(rèn)情況下,可折疊標(biāo)題小部件已展開(kāi)。這是設(shè)計(jì)使然,標(biāo)題下的內(nèi)容可見(jiàn),但可由用戶折疊。但是,您可以決定要使標(biāo)題最初折疊。您可以通過(guò)向項(xiàng)目中添加一些自定義腳本來(lái)實(shí)現(xiàn)。
# 界面/圖表報(bào)表/文檔/IDE等千款熱門(mén)軟控件火熱銷(xiāo)售中 >>
相關(guān)鏈接:
HelpStudio以最快的,最簡(jiǎn)單的方式創(chuàng)建和出版幫助系統(tǒng),并與您的桌面或基于網(wǎng)絡(luò)的應(yīng)用程序或組件整合起來(lái),包括. NET。
點(diǎn)擊下載最新版HelpStudiov2019.1
Document! X包含了最新的制作工具,它允許你在預(yù)覽自動(dòng)生成的頁(yè)面中直接增加內(nèi)容-自動(dòng)生成的文檔與功能齊全的注釋工具的無(wú)縫集成。使用Document! X,文檔可以在整個(gè)設(shè)計(jì)和開(kāi)發(fā)過(guò)程中自動(dòng)生成,而不需要花費(fèi)開(kāi)發(fā)人員的資源,同時(shí)為開(kāi)發(fā)團(tuán)隊(duì)提供了準(zhǔn)確和最新的參考,并允許新的開(kāi)發(fā)人員快速的學(xué)習(xí)新的組件和架構(gòu)。
點(diǎn)擊下載最新版Document! X v2019.1
默認(rèn)情況下,可折疊標(biāo)題小部件已展開(kāi)。這是設(shè)計(jì)使然,標(biāo)題下的內(nèi)容可見(jiàn),但可由用戶折疊。但是,您可以決定要使標(biāo)題最初折疊。您可以通過(guò)向項(xiàng)目中添加一些自定義腳本來(lái)實(shí)現(xiàn)。
注意:本文中的說(shuō)明要求您使用的是Classic,Material或Light模板或從它們派生的自定義模板。
使用記事本在項(xiàng)目腳本目錄(例如headings-initially-collapsed.js)中創(chuàng)建一個(gè)新的javascript文件,然后復(fù)制并粘貼以下腳本:
(function () { // Define a new feature constructor var collapseAllOnLoadFeature = function(documentInstance) { Innovasys.Content.DocumentFeatureBase.call(this, documentInstance); }; // .. that inherits from the DocumentFeatureBase __extends(collapseAllOnLoadFeature, Innovasys.Content.DocumentFeatureBase); // Return a unique feature name collapseAllOnLoadFeature.prototype.getName = function () { return "Collapse All Toggle Sections On Load"; }; // Make sure it initializes after the built in features collapseAllOnLoadFeature.prototype.initializeContentOrdinal = function () { return 99999; } // When the content initializes, collapse any sections that are not already collapsed collapseAllOnLoadFeature.prototype.initializeContent = function (rootSelector, isInitialLoad) { var toggleFeature = this.documentInstance.getFeatureByName("Toggle Sections"); var expandedSections = $("." + toggleFeature.getToggleHeadingClassName() +":not(." + toggleFeature.getToggleHeadingClassName() + toggleFeature.getToggledSuffix() + ")"); toggleFeature.toggleSection(expandedSections, true); } // The factory is how we register our feature with the Innovasys document object var collapseAllOnLoadFactory = function() {}; collapseAllOnLoadFactory.prototype.createInstance = function (documentInstance) { return new collapseAllOnLoadFeature(documentInstance); }; // Register our factory in the DocumentFeatureConfiguration Innovasys.Content.DocumentFeatureConfiguration.registerDocumentFeatureFactory(new collapseAllOnLoadFactory()); })();
使用添加現(xiàn)有其他文件功能區(qū)命令將創(chuàng)建的.js文件添加到項(xiàng)目中。
重建輸出后,默認(rèn)情況下,主題中的可折疊標(biāo)題小部件現(xiàn)在將在生成的輸出中折疊。
但是以上代碼對(duì)于新的Material模板是不適用的,如果您需要在新的Material模板中實(shí)踐,您可以運(yùn)用以下代碼運(yùn)行,將其添加到項(xiàng)目或自定義模板中的.js文件中,并且頁(yè)面加載時(shí)所有部分都將折疊。:
(function () { // Define a new feature constructor var collapseAllOnLoadFeature = function(documentInstance) { Innovasys.Content.DocumentFeatureBase.call(this, documentInstance); }; // .. that inherits from the DocumentFeatureBase __extends(collapseAllOnLoadFeature, Innovasys.Content.DocumentFeatureBase); // Return a unique feature name collapseAllOnLoadFeature.prototype.getName = function () { return "Collapse All Toggle Sections On Load"; }; // Make sure it initializes after the built in features collapseAllOnLoadFeature.prototype.initializeContentOrdinal = function () { return 99999; } // When the content initializes, collapse any sections that are not already collapsed collapseAllOnLoadFeature.prototype.initializeContent = function (rootSelector, isInitialLoad) { var toggleFeature = this.documentInstance.getFeatureByName("Toggle Sections"); var expandedSections = $("." + toggleFeature.getToggleHeadingClassName() +":not(." + toggleFeature.getToggleHeadingClassName() + toggleFeature.getToggledSuffix() + ")"); toggleFeature.toggleSection(expandedSections, true); } // The factory is how we register our feature with the Innovasys document object var collapseAllOnLoadFactory = function() {}; collapseAllOnLoadFactory.prototype.createInstance = function (documentInstance) { return new collapseAllOnLoadFeature(documentInstance); }; // Register our factory in the DocumentFeatureConfiguration Innovasys.Content.DocumentFeatureConfiguration.registerDocumentFeatureFactory(new collapseAllOnLoadFactory()); })();
如果您對(duì)上面的問(wèn)題有什么疑惑或者建議都可以在評(píng)論區(qū)留言,大家一起討論。
如果您對(duì)HelpStudio和Document! X感興趣,可以咨詢購(gòu)買(mǎi)正版授權(quán)軟件。
關(guān)注慧聚IT微信公眾號(hào) ???,了解產(chǎn)品的最新動(dòng)態(tài)及最新資訊。
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請(qǐng)務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請(qǐng)郵件反饋至chenjj@fc6vip.cn
文章轉(zhuǎn)載自: