Skip to content

Commit

Permalink
v 1.0.1 only load js and css in control panel
Browse files Browse the repository at this point in the history
  • Loading branch information
marionnewlevant committed Oct 11, 2016
1 parent e688100 commit 4b45168
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 11 deletions.
25 changes: 14 additions & 11 deletions mnsnitch/MnSnitchPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,19 @@ class MnSnitchPlugin extends BasePlugin
*/
public function init()
{
craft()->templates->includeJsResource('mnsnitch/js/mnsnitch.js');
craft()->templates->includeCssResource('mnsnitch/css/mnsnitch.css');
// on save entry, current user exit the entry
craft()->on('entries.onSaveEntry', function (Event $event) {
// Get saved entry
$entry = $event->params['entry'];
if ($entry) {
craft()->mnSnitch->removeCollision($entry->id);
}
});
if (craft()->request->isCpRequest())
{
craft()->templates->includeJsResource('mnsnitch/js/mnsnitch.js');
craft()->templates->includeCssResource('mnsnitch/css/mnsnitch.css');
// on save entry, current user exit the entry
craft()->on('entries.onSaveEntry', function (Event $event) {
// Get saved entry
$entry = $event->params['entry'];
if ($entry) {
craft()->mnSnitch->removeCollision($entry->id);
}
});
}
}

/**
Expand Down Expand Up @@ -69,7 +72,7 @@ public function getReleaseFeedUrl()
*/
public function getVersion()
{
return '1.0.0';
return '1.0.1';
}

/**
Expand Down
7 changes: 7 additions & 0 deletions releases.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,12 @@
"notes": [
"[Added] Initial release"
]
}, {
"version": "1.0.1",
"downloadUrl": "https://github.com/marionnewlevant/craft-snitch/archive/v1.0.1.zip",
"date": "2016-10-11T20:37:12.921Z",
"notes": [
"[Fixed] Only load snitch js and css for control panel"
]
}
]

0 comments on commit 4b45168

Please sign in to comment.