Skip to content

Commit

Permalink
Upgrade to releasse v1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
kartik-v committed Nov 25, 2014
1 parent d86c147 commit 70e7275
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
6 changes: 6 additions & 0 deletions CHANGE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
version 1.2.0
=============
**Date:** 25-Nov-2014

- (enh #7): Enhance widget to use updated plugin registration from Krajee base

version 1.1.0
=============
**Date:** 20-Nov-2014
Expand Down
14 changes: 10 additions & 4 deletions MaskMoney.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014
* @package yii2-money
* @version 1.1.0
* @version 1.2.0
*/

namespace kartik\money;
Expand All @@ -22,6 +22,11 @@
*/
class MaskMoney extends \kartik\base\InputWidget
{
/**
* @inherit doc
*/
protected $_pluginName = 'maskMoney';

/**
* @var array HTML attributes for the displayed input
*/
Expand Down Expand Up @@ -97,12 +102,13 @@ public function registerAssets()
MaskMoneyAsset::register($view);
$id = 'jQuery("#' . $this->_displayOptions['id'] . '")';
$idSave = 'jQuery("#' . $this->options['id'] . '")';
$this->registerPlugin('maskMoney', $id);
$plugin = $this->_pluginName;
$this->registerPlugin($plugin, $id);
$js = <<< JS
var val = parseFloat({$idSave}.val());
{$id}.maskMoney('mask', val);
{$id}.{$plugin}('mask', val);
{$id}.on('change', function () {
var numDecimal = {$id}.maskMoney('unmasked')[0];
var numDecimal = {$id}.{$plugin}('unmasked')[0];
{$idSave}.val(numDecimal);
{$idSave}.trigger('change');
});
Expand Down
2 changes: 1 addition & 1 deletion MaskMoneyAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014
* @package yii2-money
* @version 1.1.0
* @version 1.2.0
*/

namespace kartik\money;
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ enhancements in order to use the maskMoney plugin effectively:
### Demo
You can see detailed [documentation](http://demos.krajee.com/money) on usage of the extension.

### Latest Release
The latest version of the extension is release v1.2.0. Refer the [CHANGE LOG](https://github.com/kartik-v/yii2-money/blob/master/CHANGE.md) for details of various releases.

## Installation

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).
Expand Down

0 comments on commit 70e7275

Please sign in to comment.