Skip to content
This repository has been archived by the owner on Jan 24, 2019. It is now read-only.

Commit

Permalink
css effective on snippet
Browse files Browse the repository at this point in the history
  • Loading branch information
devthejo committed Jan 26, 2016
1 parent 9237585 commit b80728b
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions MarkupX/Css.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,9 @@ class Css extends \RedCat\Templix\CallerMarkup{
var $selector = false;
function load(){
$this->remapAttr('href');
if($this->closest('extend')){
$o = $this;
$this->closest()->onLoaded(function()use($o){
$o->addCssLink();
});
}
$this->closest()->onLoaded(function(){
$this->addCssLink();
});
}
function loaded(){
$this->addCssLink();
Expand All @@ -25,6 +22,8 @@ function addCssLink($css=null,$path='css/'){
if(!$css)
$css = $this;
$dom = $this->closest()->children('head',0);
if(!$dom)
$dom = $this->getAncestor();
if(!$dom)
return;
$href = trim($css->href?$css->href:($css->src?$css->src:key($css->attributes)));
Expand Down

0 comments on commit b80728b

Please sign in to comment.