Skip to content

Commit

Permalink
No real need to register components
Browse files Browse the repository at this point in the history
  • Loading branch information
husseinalhammad committed Jun 2, 2019
1 parent 5ceaf42 commit 4ae01df
Showing 1 changed file with 7 additions and 19 deletions.
26 changes: 7 additions & 19 deletions pipit_pinion/runtime.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,29 +63,17 @@ public function get_javascript($opts, $index, $count)
$attrs_files = $result['attrs_files'];



// create script tags
foreach($files as $key => $file) {
if(strrpos($file, '/')) {
$component = substr($file, strrpos($file, '/') + 1);
} else {
$component = $file;
}


if (!$this->component_registered($component)) {
$attrs = [];
$attrs = array();

if(isset($attrs_files[$key])) {
$attrs = $attrs_files[$key];
}

$attrs['src'] = $prefix.$file;

$out[] = $this->_script_tag($attrs);
$this->register_component($component);
if(isset($attrs_files[$key])) {
$attrs = $attrs_files[$key];
}
}

$attrs['src'] = $prefix.$file;
$out[] = $this->_script_tag($attrs);
}



Expand Down

0 comments on commit 4ae01df

Please sign in to comment.