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

Commit

Permalink
Fix Dropdown, Release 0.9.16
Browse files Browse the repository at this point in the history
  • Loading branch information
geoperez committed Jun 11, 2015
1 parent 87a61f2 commit 3f983ba
Show file tree
Hide file tree
Showing 11 changed files with 53 additions and 30 deletions.
16 changes: 11 additions & 5 deletions Unosquare.Tubular.Sample/ui/tubular/tubular-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -2412,6 +2412,8 @@ angular.module('a8m.group-by', ['a8m.filter-watcher'])
* @param {object} options Set the options to display.
* @param {string} optionsUrl Set the Http Url where to retrieve the values.
* @param {string} optionsMethod Set the Http Method where to retrieve the values.
* @param {string} optionLabel Set the property to get the labels
* @param {string} optionKey Set the property to get the keys
*/
.directive('tbDropdownEditor', [
'tubularEditorService', function(tubularEditorService) {
Expand All @@ -2430,14 +2432,18 @@ angular.module('a8m.group-by', ['a8m.filter-watcher'])
restrict: 'E',
replace: true,
transclude: true,
scope: angular.extend({ options: '=?', optionsUrl: '@', optionsMethod: '@?', optionLabel: '@?' }, tubularEditorService.defaultScope),
scope: angular.extend({ options: '=?', optionsUrl: '@', optionsMethod: '@?', optionLabel: '@?', optionKey: '@?' }, tubularEditorService.defaultScope),
controller: [
'$scope', function ($scope) {
'$scope', function($scope) {
tubularEditorService.setupScope($scope);
$scope.dataIsLoaded = false;
$scope.selectOptions = "d for d in options";
if (angular.isDefined($scope.optionLabel)) {
$scope.selectOptions = "d." + $scope.optionLabel + " for d in options";

if (angular.isDefined($scope.optionKey)) {
$scope.selectOptions = 'd.' + $scope.optionKey + ' as ' + $scope.selectOptions;
}
}

$scope.loadData = function() {
Expand All @@ -2458,7 +2464,7 @@ angular.module('a8m.group-by', ['a8m.filter-watcher'])
$scope.value = '';

currentRequest.promise.then(
function (data) {
function(data) {
$scope.options = data;
$scope.dataIsLoaded = true;
$scope.value = value;
Expand Down Expand Up @@ -2629,7 +2635,7 @@ angular.module('a8m.group-by', ['a8m.filter-watcher'])
uncheckedValue: '=?'
}, tubularEditorService.defaultScope),
controller: [
'$scope', '$element', function ($scope) {
'$scope', '$element', function($scope) {
$scope.checkedValue = angular.isDefined($scope.checkedValue) ? $scope.checkedValue : true;
$scope.uncheckedValue = angular.isDefined($scope.uncheckedValue) ? $scope.uncheckedValue : false;

Expand Down Expand Up @@ -2683,7 +2689,7 @@ angular.module('a8m.group-by', ['a8m.filter-watcher'])
transclude: true,
scope: tubularEditorService.defaultScope,
controller: [
'$scope', function ($scope) {
'$scope', function($scope) {
$scope.validate = function() {
if (angular.isUndefined($scope.min) == false && angular.isUndefined($scope.value) == false) {
if ($scope.value.length < parseInt($scope.min)) {
Expand Down
2 changes: 1 addition & 1 deletion Unosquare.Tubular.Sample/ui/tubular/tubular-bundle.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Unosquare.Tubular.Sample/ui/tubular/tubular-bundle.min.js.map

Large diffs are not rendered by default.

16 changes: 11 additions & 5 deletions Unosquare.Tubular/Javascript/tubular-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -2412,6 +2412,8 @@ angular.module('a8m.group-by', ['a8m.filter-watcher'])
* @param {object} options Set the options to display.
* @param {string} optionsUrl Set the Http Url where to retrieve the values.
* @param {string} optionsMethod Set the Http Method where to retrieve the values.
* @param {string} optionLabel Set the property to get the labels
* @param {string} optionKey Set the property to get the keys
*/
.directive('tbDropdownEditor', [
'tubularEditorService', function(tubularEditorService) {
Expand All @@ -2430,14 +2432,18 @@ angular.module('a8m.group-by', ['a8m.filter-watcher'])
restrict: 'E',
replace: true,
transclude: true,
scope: angular.extend({ options: '=?', optionsUrl: '@', optionsMethod: '@?', optionLabel: '@?' }, tubularEditorService.defaultScope),
scope: angular.extend({ options: '=?', optionsUrl: '@', optionsMethod: '@?', optionLabel: '@?', optionKey: '@?' }, tubularEditorService.defaultScope),
controller: [
'$scope', function ($scope) {
'$scope', function($scope) {
tubularEditorService.setupScope($scope);
$scope.dataIsLoaded = false;
$scope.selectOptions = "d for d in options";
if (angular.isDefined($scope.optionLabel)) {
$scope.selectOptions = "d." + $scope.optionLabel + " for d in options";

if (angular.isDefined($scope.optionKey)) {
$scope.selectOptions = 'd.' + $scope.optionKey + ' as ' + $scope.selectOptions;
}
}

$scope.loadData = function() {
Expand All @@ -2458,7 +2464,7 @@ angular.module('a8m.group-by', ['a8m.filter-watcher'])
$scope.value = '';

currentRequest.promise.then(
function (data) {
function(data) {
$scope.options = data;
$scope.dataIsLoaded = true;
$scope.value = value;
Expand Down Expand Up @@ -2629,7 +2635,7 @@ angular.module('a8m.group-by', ['a8m.filter-watcher'])
uncheckedValue: '=?'
}, tubularEditorService.defaultScope),
controller: [
'$scope', '$element', function ($scope) {
'$scope', '$element', function($scope) {
$scope.checkedValue = angular.isDefined($scope.checkedValue) ? $scope.checkedValue : true;
$scope.uncheckedValue = angular.isDefined($scope.uncheckedValue) ? $scope.uncheckedValue : false;

Expand Down Expand Up @@ -2683,7 +2689,7 @@ angular.module('a8m.group-by', ['a8m.filter-watcher'])
transclude: true,
scope: tubularEditorService.defaultScope,
controller: [
'$scope', function ($scope) {
'$scope', function($scope) {
$scope.validate = function() {
if (angular.isUndefined($scope.min) == false && angular.isUndefined($scope.value) == false) {
if ($scope.value.length < parseInt($scope.min)) {
Expand Down
2 changes: 1 addition & 1 deletion Unosquare.Tubular/Javascript/tubular-bundle.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Unosquare.Tubular/Javascript/tubular-bundle.min.js.map

Large diffs are not rendered by default.

16 changes: 11 additions & 5 deletions Unosquare.Tubular/Javascript/tubular/tubular-directives-editors.js
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,8 @@
* @param {object} options Set the options to display.
* @param {string} optionsUrl Set the Http Url where to retrieve the values.
* @param {string} optionsMethod Set the Http Method where to retrieve the values.
* @param {string} optionLabel Set the property to get the labels
* @param {string} optionKey Set the property to get the keys
*/
.directive('tbDropdownEditor', [
'tubularEditorService', function(tubularEditorService) {
Expand All @@ -368,14 +370,18 @@
restrict: 'E',
replace: true,
transclude: true,
scope: angular.extend({ options: '=?', optionsUrl: '@', optionsMethod: '@?', optionLabel: '@?' }, tubularEditorService.defaultScope),
scope: angular.extend({ options: '=?', optionsUrl: '@', optionsMethod: '@?', optionLabel: '@?', optionKey: '@?' }, tubularEditorService.defaultScope),
controller: [
'$scope', function ($scope) {
'$scope', function($scope) {
tubularEditorService.setupScope($scope);
$scope.dataIsLoaded = false;
$scope.selectOptions = "d for d in options";
if (angular.isDefined($scope.optionLabel)) {
$scope.selectOptions = "d." + $scope.optionLabel + " for d in options";

if (angular.isDefined($scope.optionKey)) {
$scope.selectOptions = 'd.' + $scope.optionKey + ' as ' + $scope.selectOptions;
}
}

$scope.loadData = function() {
Expand All @@ -396,7 +402,7 @@
$scope.value = '';

currentRequest.promise.then(
function (data) {
function(data) {
$scope.options = data;
$scope.dataIsLoaded = true;
$scope.value = value;
Expand Down Expand Up @@ -567,7 +573,7 @@
uncheckedValue: '=?'
}, tubularEditorService.defaultScope),
controller: [
'$scope', '$element', function ($scope) {
'$scope', '$element', function($scope) {
$scope.checkedValue = angular.isDefined($scope.checkedValue) ? $scope.checkedValue : true;
$scope.uncheckedValue = angular.isDefined($scope.uncheckedValue) ? $scope.uncheckedValue : false;

Expand Down Expand Up @@ -621,7 +627,7 @@
transclude: true,
scope: tubularEditorService.defaultScope,
controller: [
'$scope', function ($scope) {
'$scope', function($scope) {
$scope.validate = function() {
if (angular.isUndefined($scope.min) == false && angular.isUndefined($scope.value) == false) {
if ($scope.value.length < parseInt($scope.min)) {
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tubular",
"version": "0.9.15",
"version": "0.9.16",
"description": "A set of AngularJS directives and designed to rapidly build modern web applications.",
"homepage": "http://unosquare.github.io/tubular",
"repository": {
Expand Down
16 changes: 11 additions & 5 deletions dist/tubular-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -2412,6 +2412,8 @@ angular.module('a8m.group-by', ['a8m.filter-watcher'])
* @param {object} options Set the options to display.
* @param {string} optionsUrl Set the Http Url where to retrieve the values.
* @param {string} optionsMethod Set the Http Method where to retrieve the values.
* @param {string} optionLabel Set the property to get the labels
* @param {string} optionKey Set the property to get the keys
*/
.directive('tbDropdownEditor', [
'tubularEditorService', function(tubularEditorService) {
Expand All @@ -2430,14 +2432,18 @@ angular.module('a8m.group-by', ['a8m.filter-watcher'])
restrict: 'E',
replace: true,
transclude: true,
scope: angular.extend({ options: '=?', optionsUrl: '@', optionsMethod: '@?', optionLabel: '@?' }, tubularEditorService.defaultScope),
scope: angular.extend({ options: '=?', optionsUrl: '@', optionsMethod: '@?', optionLabel: '@?', optionKey: '@?' }, tubularEditorService.defaultScope),
controller: [
'$scope', function ($scope) {
'$scope', function($scope) {
tubularEditorService.setupScope($scope);
$scope.dataIsLoaded = false;
$scope.selectOptions = "d for d in options";
if (angular.isDefined($scope.optionLabel)) {
$scope.selectOptions = "d." + $scope.optionLabel + " for d in options";

if (angular.isDefined($scope.optionKey)) {
$scope.selectOptions = 'd.' + $scope.optionKey + ' as ' + $scope.selectOptions;
}
}

$scope.loadData = function() {
Expand All @@ -2458,7 +2464,7 @@ angular.module('a8m.group-by', ['a8m.filter-watcher'])
$scope.value = '';

currentRequest.promise.then(
function (data) {
function(data) {
$scope.options = data;
$scope.dataIsLoaded = true;
$scope.value = value;
Expand Down Expand Up @@ -2629,7 +2635,7 @@ angular.module('a8m.group-by', ['a8m.filter-watcher'])
uncheckedValue: '=?'
}, tubularEditorService.defaultScope),
controller: [
'$scope', '$element', function ($scope) {
'$scope', '$element', function($scope) {
$scope.checkedValue = angular.isDefined($scope.checkedValue) ? $scope.checkedValue : true;
$scope.uncheckedValue = angular.isDefined($scope.uncheckedValue) ? $scope.uncheckedValue : false;

Expand Down Expand Up @@ -2683,7 +2689,7 @@ angular.module('a8m.group-by', ['a8m.filter-watcher'])
transclude: true,
scope: tubularEditorService.defaultScope,
controller: [
'$scope', function ($scope) {
'$scope', function($scope) {
$scope.validate = function() {
if (angular.isUndefined($scope.min) == false && angular.isUndefined($scope.value) == false) {
if ($scope.value.length < parseInt($scope.min)) {
Expand Down
3 changes: 1 addition & 2 deletions dist/tubular-bundle.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "tubular",
"filename": "tubular-bundle.min.js",
"version": "0.9.15",
"version": "0.9.16",
"description": "A set of AngularJS directives and designed to rapidly build modern web applications.",
"repository": {
"type": "git",
Expand Down

0 comments on commit 3f983ba

Please sign in to comment.