From 241e50c53015bf57dde1e59810b8ebc7f9f92972 Mon Sep 17 00:00:00 2001 From: DianaXWiki Date: Wed, 3 Dec 2025 14:02:32 +0200 Subject: [PATCH 1/2] Add data-type attribute #2123 --- www/common/drive-ui.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/www/common/drive-ui.js b/www/common/drive-ui.js index 0466f4e3b..11c36015c 100644 --- a/www/common/drive-ui.js +++ b/www/common/drive-ui.js @@ -501,6 +501,7 @@ define([ h("ul.dropdown-menu", getNewPadTypes().map(function (app) { return isAppEnabled(app) ? h('li', h('a.cp-app-drive-context-newdoc.dropdown-item.cp-app-drive-context-editable' + (restricted[app] === 0 ? '.cp-app-disabled' : ''), { 'tabindex': '-1', + 'data-type': app, },[ Icons.get(AppConfig.applicationsIcon[app] || 'file'), Messages.type[app] @@ -5291,7 +5292,8 @@ define([ showUploadFolderModal(); } else if ($this.hasClass("cp-app-drive-context-newdoc")) { - var ntype = $this.data('type') || 'pad'; + console.log($this.data('type')); + var ntype = $this.data('type') || 'code'; if (ntype === 'link') { return void showLinkModal(); } From 60f92628f423106365f211021149c432b45c4805 Mon Sep 17 00:00:00 2001 From: DianaXWiki Date: Wed, 3 Dec 2025 14:19:58 +0200 Subject: [PATCH 2/2] Remove extras --- www/common/drive-ui.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/www/common/drive-ui.js b/www/common/drive-ui.js index 11c36015c..e9b663593 100644 --- a/www/common/drive-ui.js +++ b/www/common/drive-ui.js @@ -5292,8 +5292,7 @@ define([ showUploadFolderModal(); } else if ($this.hasClass("cp-app-drive-context-newdoc")) { - console.log($this.data('type')); - var ntype = $this.data('type') || 'code'; + var ntype = $this.data('type') || 'pad'; if (ntype === 'link') { return void showLinkModal(); }