Skip to content
This repository has been archived by the owner on Oct 18, 2022. It is now read-only.

Commit

Permalink
Fixes an issue where Reasons would not work in Craft 2.6.3007 or newe…
Browse files Browse the repository at this point in the history
…r. Bump to 1.0.11
  • Loading branch information
mmikkel committed Feb 6, 2018
1 parent 852c231 commit 82e6963
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 22 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Reasons v. 1.0.10 for Craft CMS ![Craft 2.5](https://img.shields.io/badge/craft-2.5-red.svg?style=flat-square)
# Reasons v. 1.0.11 for Craft CMS ![Craft 2.5](https://img.shields.io/badge/craft-2.5-red.svg?style=flat-square)

## Update June 22nd, 2017: [Statement regarding Reasons 2, Matrix support and Craft 3](https://github.com/mmikkel/Reasons-Craft/wiki/Statement-on-Reasons-2,-Matrix-and-Craft-3) (TL;DR: development on Reasons has been retired)

Expand Down Expand Up @@ -114,6 +114,10 @@ Please report any bugs, feature requests or other issues [here](https://github.c

### Changelog

#### 1.0.11 (02.06.2018)

* [Fixed] Fixes an issue where Reasons would not work in Craft 2.6.3007 or newer

#### 1.0.10 (26.06.2017)

* [Fixed] Fixes issue where Reasons would not work with drafts/entry revisions
Expand Down
2 changes: 1 addition & 1 deletion reasons/ReasonsPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
class ReasonsPlugin extends BasePlugin
{

protected $_version = '1.0.10';
protected $_version = '1.0.11';
protected $_schemaVersion = '1.1';
protected $_developer = 'Mats Mikkel Rummelhoff';
protected $_developerUrl = 'http://mmikkel.no';
Expand Down
8 changes: 8 additions & 0 deletions reasons/resources/javascripts/reasons-6d1c1d9af95536f0cfb1.js

Large diffs are not rendered by default.

8 changes: 0 additions & 8 deletions reasons/resources/javascripts/reasons-abe55bbd64711542b904.js

This file was deleted.

2 changes: 1 addition & 1 deletion reasons/resources/rev-manifest.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"javascripts/reasons.js": "javascripts/reasons-abe55bbd64711542b904.js",
"javascripts/reasons.js": "javascripts/reasons-6d1c1d9af95536f0cfb1.js",
"stylesheets/reasons.css": "stylesheets/reasons-8f9624f667.css"
}
8 changes: 8 additions & 0 deletions releases.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
[
{
"version": "1.0.11",
"downloadUrl": "https://github.com/mmikkel/Reasons-Craft/archive/master.zip",
"date": "2018-02-06T11:00:00-08:00",
"notes": [
"[Fixed] Fixes an issue where Reasons would not work in Craft 2.6.3007 or newer"
]
},
{
"version": "1.0.10",
"downloadUrl": "https://github.com/mmikkel/Reasons-Craft/archive/master.zip",
Expand Down
15 changes: 8 additions & 7 deletions source/javascripts/modules/fld.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,13 @@ module.exports = class {

constructor ($el, conditionals)
{


if (!$el || !$el.length) {
return;
}

this.$el = $el;

this.conditionals = conditionals;

this.settings = {
Expand Down Expand Up @@ -33,10 +38,6 @@ module.exports = class {
init ()
{

// Get form
this.$form = this.$el.closest(this.settings.formSelector);
if (!this.$form || this.$form.length === 0) return false;

// Get available toggle field IDs
var toggleFields = Craft.ReasonsPlugin.getToggleFields();
this.toggleFieldIds = $.map(toggleFields, function(toggleField){
Expand All @@ -57,7 +58,7 @@ module.exports = class {
}));

// Append the hidden input fields
this.$form
this.$el
.append(this.$conditionalsInput)
.append(this.$conditionalsIdInput)
// Attach submit event listener
Expand Down Expand Up @@ -256,4 +257,4 @@ module.exports = class {
this.refresh();
}

}
}
10 changes: 6 additions & 4 deletions source/javascripts/reasons.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,12 @@
initPrimaryForm : function ()
{
this.destroyPrimaryForm();
var $form = (Craft.cp.$primaryForm && Craft.cp.$primaryForm.length) ? Craft.cp.$primaryForm : $('#content form:first');
if ($form && $form.length) {
this.primaryForm = this.initForm($form);
}
Garnish.requestAnimationFrame((function () {
var $form = (Craft.cp.$primaryForm && Craft.cp.$primaryForm.length) ? Craft.cp.$primaryForm : $('#content form:first');
if ($form && $form.length) {
this.primaryForm = this.initForm($form);
}
}).bind(this));
},

destroyPrimaryForm : function ()
Expand Down

0 comments on commit 82e6963

Please sign in to comment.