mirror of
https://github.com/AleziaKurdis/overte.git
synced 2025-04-09 12:12:50 +02:00
Merge pull request #13794 from zfox23/72_MS17495
Fix MS17495: Initially wire sendMessage to ignore in appUi module
This commit is contained in:
commit
1c9e409444
1 changed files with 11 additions and 4 deletions
|
@ -87,12 +87,18 @@ function AppUi(properties) {
|
|||
defaultButton('activeButton', 'a.svg');
|
||||
defaultButton('normalMessagesButton', 'i-msg.svg');
|
||||
defaultButton('activeMessagesButton', 'a-msg.svg');
|
||||
that.button = that.tablet.addButton({
|
||||
var buttonOptions = {
|
||||
icon: that.normalButton,
|
||||
activeIcon: that.activeButton,
|
||||
text: that.buttonName,
|
||||
sortOrder: that.sortOrder
|
||||
});
|
||||
text: that.buttonName
|
||||
};
|
||||
// `TabletScriptingInterface` looks for the presence of a `sortOrder` key.
|
||||
// What it SHOULD do is look to see if the value inside that key is defined.
|
||||
// To get around the current code, we do this instead.
|
||||
if (that.sortOrder) {
|
||||
buttonOptions.sortOrder = that.sortOrder;
|
||||
}
|
||||
that.button = that.tablet.addButton(buttonOptions);
|
||||
that.ignore = function ignore() { };
|
||||
|
||||
// Handlers
|
||||
|
@ -126,6 +132,7 @@ function AppUi(properties) {
|
|||
// (Although injected javascript still has to use JSON.stringify/JSON.parse.)
|
||||
that.sendToHtml = function (messageObject) { that.tablet.emitScriptEvent(JSON.stringify(messageObject)); };
|
||||
that.fromHtml = function (messageString) { that.onMessage(JSON.parse(messageString)); };
|
||||
that.sendMessage = that.ignore;
|
||||
that.wireEventBridge = function wireEventBridge(on) {
|
||||
// Uniquivocally sets that.sendMessage(messageObject) to do the right thing.
|
||||
// Sets hasEventBridge and wires onMessage to eventSignal as appropriate, IFF onMessage defined.
|
||||
|
|
Loading…
Reference in a new issue