I am implementing sticky notes using jquery ui dialog boxes. On a button click a big full screen ui dialog box is opened and inside that big dialog box is a button to add small dialog boxes (notes).
HTML:
<body>
<button id="opener">open the dialog</button>
<div id="outter-dialog" title="Notes">
<button id = "add-note">Add Note</button>
</div>
JS:
$( "#outter-dialog" ).dialog({
autoOpen: false,
title: "Success Message",
width: $(window).width(),
height: $(window).height(),
modal: false,
buttons: {
Cancel: function() {
$(this).dialog('close');
}
}
});
$("#opener").click(function(){
$( "#outter-dialog" ).dialog('open');
});
var prevelement;
$("#add-note").click(function () {
var dynamicDialog = $('<div id="MyDialog"> <textarea>Hello</textarea> </div>');
var pos;
if (prevelement) {
pos = {
my: "left",
at: "bottom",
of: prevelement
}
}
dynamicDialog.dialog({
title: "Note",
modal: false,
appendTo: "#outter-dialog",
buttons: [{
text: "Save",
click: function () {}
}],
position: pos
});
prevelement = dynamicDialog
});
Now I have an issue when I add appendTo: "#outter-dialog"
to my dynamic small dialog boxes (notes):
after appending them to outter dialog box they are no longer resizable and draggable.
I appended them to outter dilaog box so that on open/close of outter dialog box inner notes are shown/hidden.
Any idea why they are not draggable and resizable??