Menu: parse HTML entities for title property of events
This commit is contained in:
parent
ff1e6d4833
commit
0de55efb96
2 changed files with 10 additions and 7 deletions
|
@ -1204,7 +1204,6 @@ Ox.List = function(options, self) {
|
||||||
// fixme: callback is never used
|
// fixme: callback is never used
|
||||||
// note: can't use selectNone here,
|
// note: can't use selectNone here,
|
||||||
// since it'd trigger a select event
|
// since it'd trigger a select event
|
||||||
Ox.Log('List', 'SET SELECTED', ids)
|
|
||||||
var counter = 0;
|
var counter = 0;
|
||||||
self.$items.forEach(function($item, pos) {
|
self.$items.forEach(function($item, pos) {
|
||||||
if (isSelected(pos)) {
|
if (isSelected(pos)) {
|
||||||
|
|
|
@ -137,7 +137,7 @@ Ox.Menu = function(options, self) {
|
||||||
if (self.options.parent) {
|
if (self.options.parent) {
|
||||||
self.options.parent.hideMenu(true).triggerEvent('click', Ox.extend({
|
self.options.parent.hideMenu(true).triggerEvent('click', Ox.extend({
|
||||||
id: item.options('id'),
|
id: item.options('id'),
|
||||||
title: Ox.stripTags(item.options('title')[0])
|
title: parseTitle(item.options('title')[0])
|
||||||
}, files ? {files: files} : {}));
|
}, files ? {files: files} : {}));
|
||||||
}
|
}
|
||||||
if (item.options('checked') !== null) {
|
if (item.options('checked') !== null) {
|
||||||
|
@ -154,7 +154,7 @@ Ox.Menu = function(options, self) {
|
||||||
return {
|
return {
|
||||||
id: that.items[pos + offset].options('id'),
|
id: that.items[pos + offset].options('id'),
|
||||||
title: Ox.isString(that.items[pos + offset].options('title')[0])
|
title: Ox.isString(that.items[pos + offset].options('title')[0])
|
||||||
? Ox.stripTags(that.items[pos + offset].options('title')[0]) : ''
|
? parseTitle(that.items[pos + offset].options('title')[0]) : ''
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
@ -165,7 +165,7 @@ Ox.Menu = function(options, self) {
|
||||||
checked: item.options('checked'),
|
checked: item.options('checked'),
|
||||||
id: item.options('id'),
|
id: item.options('id'),
|
||||||
title: Ox.isString(item.options('title')[0])
|
title: Ox.isString(item.options('title')[0])
|
||||||
? Ox.stripTags(item.options('title')[0]) : ''
|
? parseTitle(item.options('title')[0]) : ''
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -174,7 +174,7 @@ Ox.Menu = function(options, self) {
|
||||||
if (!item.options('file') || files) {
|
if (!item.options('file') || files) {
|
||||||
menu.triggerEvent('click', Ox.extend({
|
menu.triggerEvent('click', Ox.extend({
|
||||||
id: item.options('id'),
|
id: item.options('id'),
|
||||||
title: Ox.stripTags(item.options('title')[0])
|
title: parseTitle(item.options('title')[0])
|
||||||
}, files ? {files: files} : {}));
|
}, files ? {files: files} : {}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -290,6 +290,10 @@ Ox.Menu = function(options, self) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function parseTitle(title) {
|
||||||
|
return Ox.decodeHTMLEntities(Ox.stripTags(title));
|
||||||
|
}
|
||||||
|
|
||||||
function renderItems(items) {
|
function renderItems(items) {
|
||||||
|
|
||||||
var offset = 0;
|
var offset = 0;
|
||||||
|
@ -472,7 +476,7 @@ Ox.Menu = function(options, self) {
|
||||||
/* disabled
|
/* disabled
|
||||||
that.triggerEvent('deselect', {
|
that.triggerEvent('deselect', {
|
||||||
id: item.options('id'),
|
id: item.options('id'),
|
||||||
title: Ox.stripTags(item.options('title')[0])
|
title: Ox.parseTitle(item.options('title')[0])
|
||||||
});
|
});
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
@ -493,7 +497,7 @@ Ox.Menu = function(options, self) {
|
||||||
that.triggerEvent('select', {
|
that.triggerEvent('select', {
|
||||||
id: item.options('id'),
|
id: item.options('id'),
|
||||||
title: Ox.isString(item.options('title')[0])
|
title: Ox.isString(item.options('title')[0])
|
||||||
? Ox.stripTags(item.options('title')[0]) : ''
|
? parseTitle(item.options('title')[0]) : ''
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
self.options.selected = position;
|
self.options.selected = position;
|
||||||
|
|
Loading…
Reference in a new issue