-
-
Notifications
You must be signed in to change notification settings - Fork 206
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TASK] Migrate grid column view element to esm (#1419)
- Loading branch information
1 parent
e11054b
commit 1462f2f
Showing
4 changed files
with
68 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the package bk2k/bootstrap-package. | ||
* | ||
* For the full copyright and license information, please read the | ||
* LICENSE file that was distributed with this source code. | ||
*/ | ||
|
||
return [ | ||
'dependencies' => [ | ||
'core', | ||
'form', | ||
], | ||
'imports' => [ | ||
'@bk2k/bootstrap-package/' => 'EXT:bootstrap_package/Resources/Public/JavaScript/ESM/', | ||
], | ||
]; |
130 changes: 0 additions & 130 deletions
130
Resources/Public/JavaScript/Backend/FormEditor/GridColumnViewModel.js
This file was deleted.
Oops, something went wrong.
48 changes: 48 additions & 0 deletions
48
Resources/Public/JavaScript/ESM/backend/form-editor/grid-column-view-model.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/** | ||
* Module: @bk2k/bootstrap-package/backend/form-editor/grid-column-view-model.js | ||
*/ | ||
|
||
import $ from 'jquery'; | ||
import * as StageComponent from '@typo3/form/backend/form-editor/stage-component.js'; | ||
|
||
/** | ||
* @private | ||
* | ||
* @return object | ||
*/ | ||
function getPublisherSubscriber(formEditorApp) { | ||
return formEditorApp.getPublisherSubscriber(); | ||
} | ||
|
||
/** | ||
* @private | ||
* | ||
* @return void | ||
*/ | ||
function subscribeEvents(formEditorApp) { | ||
/** | ||
* @private | ||
* | ||
* @param string | ||
* @param array | ||
* args[0] = formElement | ||
* args[1] = template | ||
* @return void | ||
* @subscribe view/stage/abstract/render/template/perform | ||
*/ | ||
getPublisherSubscriber(formEditorApp).subscribe('view/stage/abstract/render/template/perform', function (topic, args) { | ||
if (args[0].get('type') === 'GridColumn') { | ||
StageComponent.renderCheckboxTemplate(args[0], args[1]); | ||
} | ||
}); | ||
} | ||
|
||
/** | ||
* @public | ||
* | ||
* @param object formEditorApp | ||
* @return void | ||
*/ | ||
export function bootstrap(formEditorApp) { | ||
subscribeEvents(formEditorApp); | ||
} |