Skip to content

Commit

Permalink
Fix #212: Enhancements to support Bootstrap v5.x
Browse files Browse the repository at this point in the history
  • Loading branch information
kartik-v committed Sep 6, 2021
1 parent e330917 commit 0abdb04
Show file tree
Hide file tree
Showing 15 changed files with 39 additions and 33 deletions.
12 changes: 7 additions & 5 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ When [reporting bugs][reporting-bugs] or
[issue tracker on GitHub][issue-tracker] is the recommended channel to use.

The issue tracker **is not** a place for support requests. Refer the
[extension documentation and demos](http://demos.krajee.com/editable) and/or refer to the
[widget documentation and demos](http://demos.krajee.com/editable) and/or refer to the
[webtips Q & A forum](http://webtips.krajee.com/questions) which are the better places to get help.

Reporting bugs with yii2-editable
---------------------------------
--------------------------------
We really appreciate clear bug reports that _consistently_ show an issue
_within yii2-editable_.

Expand All @@ -31,8 +31,9 @@ The ideal bug report follows these guidelines:
has already been reported.
2. **Check if the issue has been fixed** — Try to reproduce the problem
using the code in the `master` branch.
3. **Isolate the problem** — Try to share a demo or a test case that
consistently reproduces the problem.
3. **Isolate the problem** — Try to create an
[isolated js fiddle][isolated-case] that consistently reproduces the problem
in case of javascript/client level code issues.

Please try to be as detailed as possible in your bug report, especially if an
isolated test case cannot be made. Some useful questions to include the answer
Expand All @@ -48,7 +49,7 @@ to are:
All of these questions will help others fix and identify any potential bugs.

Requesting features in yii2-editable
------------------------------------
--------------------------------------------
Before starting work on a major feature for yii2-editable, **read the
[documentation](http://demos.krajee.com/editable) first** or you may risk spending a considerable amount of
time on something which the project developers are not interested in bringing into the project.
Expand Down Expand Up @@ -119,6 +120,7 @@ It should also be made clear that **all code contributed to yii2-editable** must
licensable under the [BSD-3 license][licensing]. Code that cannot be released
under this license **cannot be accepted** into the project.

[isolated-case]: https://jsfiddle.net/
[issue-search]: https://github.com/kartik-v/yii2-editable/search?q=&type=Issues
[issue-tracker]: https://github.com/kartik-v/yii2-editable/issues
[licensing]: https://github.com/kartik-v/yii2-editable/blob/master/LICENSE.md
Expand Down
14 changes: 8 additions & 6 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

- [ ] I have searched for similar issues in both open and closed tickets and cannot find a duplicate.
- [ ] The issue still exists against the latest `master` branch of yii2-editable.
- [ ] This is not an usage question. I confirm having gone through and read the [documentation and demos](http://demos.krajee.com/editable).
- [ ] This is not an usage question. I confirm having read the [widget documentation and demos](http://demos.krajee.com/editable).
- [ ] This is not a general programming / coding question. (Those should be directed to the [webtips Q & A forum](http://webtips.krajee.com/questions)).
- [ ] This is not a source plugin (summernote) issue. (Those should be directed to the [plugin issues repo](https://github.com/summernote/summernote/search?q=&type=Issues)).
- [ ] I have attempted to find the simplest possible steps to reproduce the issue.
- [ ] I have included a failing test as a pull request (Optional).

Expand All @@ -21,27 +22,28 @@ I was expecting...

## Environment

#### Browsers
Browsers

- [ ] Google Chrome
- [ ] Mozilla Firefox
- [ ] Internet Explorer
- [ ] Safari

#### Operating System
Operating System

- [ ] Windows
- [ ] Mac OS X
- [ ] Linux
- [ ] Mobile

#### Libraries
Libraries

- jQuery version:
- yii2-editable version:

## Isolating the problem

- [ ] This bug happens [on the demos page](https://demos.krajee.com/editable)
- [ ] This bug happens [on the widget demos page](http://demos.krajee.com/editable)
- [ ] The bug happens consistently across all tested browsers
- [ ] This bug happens when using yii2-editable without other plugins.
- [ ] This bug happens when using yii2-editable without other plugins
- [ ] I can reproduce this bug in [a jsbin](https://jsbin.com/)
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This pull request includes a
- [ ] Translation

## Changes
The following changes were made (this change is also documented in the [change log](https://github.com/kartik-v/yii2-editable/blob/master/CHANGE.md)):
The following changes were made

-
-
Expand Down
3 changes: 2 additions & 1 deletion CHANGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ Change Log: `yii2-editable`

## Version 1.7.9

**Date:** 27-Nov-2020
**Date:** 06-Sep-2021

- (enh #212): Enhancements to support Bootstrap v5.x.
- (enh #206): Validate undefined data returned to ajax call.
- (enh #198): Initialize value for model.
- (enh #184): Add gitattributes.
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2015 - 2018, Kartik Visweswaran
Copyright (c) 2015 - 2021, Kartik Visweswaran
Krajee.com
All rights reserved.

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
}
],
"require": {
"kartik-v/yii2-widget-activeform": ">=1.5.7",
"kartik-v/yii2-widget-activeform": ">=1.6.0",
"kartik-v/yii2-popover-x": "~1.3"
},
"autoload": {
Expand Down
20 changes: 11 additions & 9 deletions src/Editable.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
/**
* @package yii2-editable
* @author Kartik Visweswaran <kartikv2@gmail.com>
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2015 - 2020
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2015 - 2021
* @version 1.7.9
*/

namespace kartik\editable;

use Closure;
use Exception;
use kartik\base\Config;
use kartik\base\InputWidget;
use kartik\popover\PopoverX;
Expand All @@ -17,6 +18,7 @@
use yii\helpers\ArrayHelper;
use yii\helpers\Html;
use yii\web\View;
use yii\widgets\ActiveField;
use yii\widgets\ActiveForm;

/**
Expand Down Expand Up @@ -624,15 +626,15 @@ public function getForm()

/**
* Initialize default icons
* @throws InvalidConfigException
* @throws InvalidConfigException|Exception
*/
protected function initIcons()
{
$isBs4 = $this->isBs4();
$notBs3 = !$this->isBs(3);
$prefix = $this->getDefaultIconPrefix();
foreach (static::$_icons as $icon => $setting) {
if (!isset($this->$icon)) {
$css = $isBs4 ? $setting[1] : $setting[0];
$css = $notBs3 ? $setting[1] : $setting[0];
$this->$icon = Html::tag('i', '', ['class' => $prefix . $css]);
}
}
Expand Down Expand Up @@ -664,7 +666,7 @@ protected function initEditable()
$this->initOptions();
$this->_popoverOptions['options']['id'] = $this->options['id'] . '-popover';
$this->_popoverOptions['toggleButton']['id'] = $this->options['id'] . '-targ';
if ($this->isBs4()) {
if (!$this->isBs(3)) {
$this->_popoverOptions['bsVersion'] = $this->bsVersion;
}
$this->registerAssets();
Expand All @@ -679,7 +681,7 @@ protected function initEditable()
}
echo Html::beginTag('div', $this->contentOptions);
/**
* @var ActiveForm $class
* @var string|ActiveForm $class
*/
$class = $this->formClass;
if (!class_exists($class)) {
Expand All @@ -699,7 +701,7 @@ protected function runEditable()
if (!$this->asPopover) {
echo Html::beginTag('div', $this->inlineSettings['options']);
}
echo $this->renderFormFields();
$this->renderFormFields();
if (!$this->asPopover) {
echo "</div>\n"; // inline options
}
Expand Down Expand Up @@ -966,7 +968,7 @@ protected function renderFormFields()
*
* @param boolean|string $label the label for the field
*
* @return \yii\widgets\ActiveField
* @return ActiveField
*/
protected function getField($label = false)
{
Expand Down Expand Up @@ -1009,7 +1011,7 @@ protected function renderHtml5Input()
* @param string $class the input widget class name
*
* @return string
* @throws \Exception
* @throws Exception
*/
protected function renderWidget($class)
{
Expand Down
3 changes: 1 addition & 2 deletions src/EditableAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
/**
* @package yii2-editable
* @author Kartik Visweswaran <kartikv2@gmail.com>
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2015 - 2020
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2015 - 2021
* @version 1.7.9
*/

namespace kartik\editable;

use Yii;
use kartik\base\AssetBundle;

/**
Expand Down
2 changes: 1 addition & 1 deletion src/EditablePjaxAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* @package yii2-editable
* @author Kartik Visweswaran <kartikv2@gmail.com>
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2015 - 2020
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2015 - 2021
* @version 1.7.9
*/

Expand Down
2 changes: 1 addition & 1 deletion src/assets/css/editable.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*!
* @package yii2-editable
* @author Kartik Visweswaran <kartikv2@gmail.com>
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2015 - 2020
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2015 - 2021
* @version 1.7.9
*
* Styling for the Editable widget
Expand Down
2 changes: 1 addition & 1 deletion src/assets/css/editable.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/assets/js/editable-pjax.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*!
* @package yii2-editable
* @author Kartik Visweswaran <kartikv2@gmail.com>
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2015 - 2020
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2015 - 2021
* @version 1.7.9
*
* Editable Extension - PJAX processing script for popover-x
Expand Down
2 changes: 1 addition & 1 deletion src/assets/js/editable-pjax.min.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*!
* @package yii2-editable
* @author Kartik Visweswaran <kartikv2@gmail.com>
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2015 - 2020
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2015 - 2021
* @version 1.7.9
*
* Editable Extension - PJAX processing script for popover-x
Expand Down
2 changes: 1 addition & 1 deletion src/assets/js/editable.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*!
* @package yii2-editable
* @author Kartik Visweswaran <kartikv2@gmail.com>
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2015 - 2020
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2015 - 2021
* @version 1.7.9
*
* Editable Extension jQuery plugin
Expand Down
2 changes: 1 addition & 1 deletion src/assets/js/editable.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0abdb04

Please sign in to comment.