Changes extra components function register and array name

This commit is contained in:
Mateus Machado Luna 2020-02-07 13:31:52 -03:00
parent bb7d80dac5
commit bdef054d45
2 changed files with 10 additions and 10 deletions

View File

@ -69,6 +69,13 @@ Vue.use(ConsolePlugin, {visual: false});
Vue.use(VueTheMask); Vue.use(VueTheMask);
Vue.use(CommentsStatusHelperPlugin); Vue.use(CommentsStatusHelperPlugin);
/* Registers Extra Vue Components passed to the TainacanExtraVueComponents */
if (typeof TainacanExtraVueComponents != "undefined") {
for (let [extraVueComponentName, extraVueComponentObject] of Object.entries(TainacanExtraVueComponents))
Vue.component(extraVueComponentName, extraVueComponentObject);
}
/* Metadata */ /* Metadata */
Vue.component('tainacan-text', Text); Vue.component('tainacan-text', Text);
Vue.component('tainacan-textarea', Textarea); Vue.component('tainacan-textarea', Textarea);
@ -99,13 +106,6 @@ Vue.component('tainacan-filter-numeric-interval', FilterNumericInterval);
Vue.component('tainacan-filter-numeric-list-interval', FilterNumericListInterval); Vue.component('tainacan-filter-numeric-list-interval', FilterNumericListInterval);
Vue.component('tainacan-filter-date-interval', FilterDateInterval); Vue.component('tainacan-filter-date-interval', FilterDateInterval);
/* Registers Extra Filter Components passed to the TainacanExtraFilter */
if (typeof TainacanExtraFilters != "undefined") {
for (let [extraFilter, extraFilterObject] of Object.entries(TainacanExtraFilters))
Vue.component(extraFilter, extraFilterObject);
}
/* Filter Metadata Option forms */ /* Filter Metadata Option forms */
Vue.component('tainacan-filter-form-numeric', FormFilterNumeric); Vue.component('tainacan-filter-form-numeric', FormFilterNumeric);
Vue.component('tainacan-filter-form-numeric-interval', FormFilterNumericInterval); Vue.component('tainacan-filter-form-numeric-interval', FormFilterNumericInterval);

View File

@ -29,7 +29,7 @@ class Component_Hooks {
} }
private function init() { private function init() {
do_action('tainacan-register-js-component', $this); do_action('tainacan-register-vuejs-component', $this);
} }
public function register_component() { public function register_component() {
@ -37,13 +37,13 @@ class Component_Hooks {
} }
/** /**
* Register a new component * Register a new vuejs component
* *
* @param string $handle name of the component. Should be unique. * @param string $handle name of the component. Should be unique.
* @param string $script_path path of file component * @param string $script_path path of file component
* @param array|string $args * @param array|string $args
*/ */
public function register_js_component($handle, $script_path, $args = []) { public function register_vuejs_component($handle, $script_path, $args = []) {
global $TAINACAN_EXTRA_SCRIPTS; global $TAINACAN_EXTRA_SCRIPTS;
$this->handle = $handle; $this->handle = $handle;