Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:okfn/ckan
- Loading branch information
Showing
15 changed files
with
275 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* Dataset visibility toggler | ||
* When no organization is selected in the org dropdown then set visibility to | ||
* public always and disable dropdown | ||
*/ | ||
this.ckan.module('dataset-visibility', function ($, _) { | ||
return { | ||
currentValue: false, | ||
options: { | ||
organizations: $('#field-organizations'), | ||
visibility: $('#field-private'), | ||
currentValue: null | ||
}, | ||
initialize: function() { | ||
$.proxyAll(this, /_on/); | ||
this.options.currentValue = this.options.visibility.val(); | ||
this.options.organizations.on('change', this._onOrganizationChange); | ||
this._onOrganizationChange(); | ||
}, | ||
_onOrganizationChange: function() { | ||
var value = this.options.organizations.val(); | ||
if (value) { | ||
this.options.visibility | ||
.prop('disabled', false) | ||
.val(this.options.currentValue); | ||
} else { | ||
this.options.visibility | ||
.prop('disabled', true) | ||
.val('False'); | ||
} | ||
} | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.