翻譯|使用教程|編輯:況魚杰|2019-11-21 14:51:08.460|閱讀 255 次
概述:默認(rèn)情況下,可折疊標(biāo)題小部件已展開。這是設(shè)計使然,標(biāo)題下的內(nèi)容可見,但可由用戶折疊。但是,您可以決定要使標(biāo)題最初折疊。您可以通過向項目中添加一些自定義腳本來實現(xiàn)。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關(guān)鏈接:
HelpStudio以最快的,最簡單的方式創(chuàng)建和出版幫助系統(tǒng),并與您的桌面或基于網(wǎng)絡(luò)的應(yīng)用程序或組件整合起來,包括. NET。
Document! X包含了最新的制作工具,它允許你在預(yù)覽自動生成的頁面中直接增加內(nèi)容-自動生成的文檔與功能齊全的注釋工具的無縫集成。使用Document! X,文檔可以在整個設(shè)計和開發(fā)過程中自動生成,而不需要花費開發(fā)人員的資源,同時為開發(fā)團(tuán)隊提供了準(zhǔn)確和最新的參考,并允許新的開發(fā)人員快速的學(xué)習(xí)新的組件和架構(gòu)。
默認(rèn)情況下,可折疊標(biāo)題小部件已展開。這是設(shè)計使然,標(biāo)題下的內(nèi)容可見,但可由用戶折疊。但是,您可以決定要使標(biāo)題最初折疊。您可以通過向項目中添加一些自定義腳本來實現(xiàn)。
注意:本文中的說明要求您使用的是Classic,Material或Light模板或從它們派生的自定義模板。
使用記事本在項目腳本目錄(例如headings-initially-collapsed.js)中創(chuàng)建一個新的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文件添加到項目中。
重建輸出后,默認(rèn)情況下,主題中的可折疊標(biāo)題小部件現(xiàn)在將在生成的輸出中折疊。
但是以上代碼對于新的Material模板是不適用的,如果您需要在新的Material模板中實踐,您可以運用以下代碼運行,將其添加到項目或自定義模板中的.js文件中,并且頁面加載時所有部分都將折疊。:
(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()); })();
如果您對上面的問題有什么疑惑或者建議都可以在評論區(qū)留言,大家一起討論。
如果您對HelpStudio和Document! X感興趣,可以咨詢購買正版授權(quán)軟件。
關(guān)注慧聚IT微信公眾號 ???,了解產(chǎn)品的最新動態(tài)及最新資訊。
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請郵件反饋至chenjj@fc6vip.cn
文章轉(zhuǎn)載自: