Commit 594ab7d1 authored by Prakhar Agarwal's avatar Prakhar Agarwal 🎯
Browse files

Fixed spaces and target bug

parent 43b10ce7
......@@ -50,7 +50,7 @@
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" id="send-message-btn" class="btn btn-primary">Send message</button>
<button type="button" id="send-message-btn" class="btn btn-primary" onclick="pdbundle.pdgui.web_menu_send()">Send message</button>
</div>
</div>
</div>
......
......@@ -1192,15 +1192,6 @@ function menu_send(name) {
if (is_webapp) {
$("#message-modal").modal("show");
$("#message-text").val(name);
$("#send-message-btn").click(function() {
var message = $("#message-text").val();
if (message != undefined && message.length) {
post("Sending message to Pd: " + message + ";");
pdsend(message);
}
$("#message-text").val("");
$("#message-modal").modal("hide");
});
} else {
var message,
win = name ? patchwin[name] : pd_window;
......@@ -1212,6 +1203,19 @@ function menu_send(name) {
}
}
function web_menu_send() {
var message = $("#message-text").val();
console.log("Message", typeof(message));
if (message != undefined && message.length) {
post("Sending message to Pd: " + message + ";");
pdsend(message);
}
$("#message-text").val("");
$("#message-modal").modal("hide");
}
exports.web_menu_send = web_menu_send;
// requires nw.js API (Menuitem)
function canvas_set_editmode(cid, state) {
var patchsvg_id = is_webapp() ? "patchsvg_"+cid : "patchsvg"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment