mirror of
https://github.com/humhub/humhub.git
synced 2025-01-17 22:28:51 +01:00
Fix: js action api empty data attribute
This commit is contained in:
parent
b030bc0ef3
commit
594c14d31e
@ -218,7 +218,6 @@ humhub.module('action', function(module, require, $) {
|
||||
Component._buildSelector();
|
||||
//Binding default action types
|
||||
this.bindAction(document, 'click', '[data-action-click]');
|
||||
this.bindAction(document, 'dblclick', '[data-action-dblclick]');
|
||||
this.bindAction(document, 'change', '[data-action-change]');
|
||||
}
|
||||
|
||||
@ -334,7 +333,7 @@ humhub.module('action', function(module, require, $) {
|
||||
|
||||
var event = this.createActionEvent(options);
|
||||
|
||||
if(this.data($trigger, 'confirm') && !options.confirmed) {
|
||||
if(object.isDefined(this.data($trigger, 'confirm')) && !options.confirmed) {
|
||||
var that = this;
|
||||
modal.confirm($trigger).then(function(confirmed) {
|
||||
if(confirmed) {
|
||||
@ -444,16 +443,16 @@ humhub.module('action', function(module, require, $) {
|
||||
* @param {type} $trigger
|
||||
* @param {type} name
|
||||
* @param {type} def
|
||||
* @returns {unresolved}
|
||||
* @returns {mixed}
|
||||
*/
|
||||
ActionBinding.prototype.data = function($trigger, name, def) {
|
||||
var result = $trigger.data('action-' + this.eventType + '-' + name);
|
||||
|
||||
if(!result) {
|
||||
if(!object.isDefined(result)) {
|
||||
result = $trigger.data('action-' + name);
|
||||
}
|
||||
|
||||
return result || def;
|
||||
return object.isDefined(result) ? result : def;
|
||||
};
|
||||
|
||||
ActionBinding.prototype.getUrl = function($trigger) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user