Implement close button
This commit is contained in:
parent
52e2eed5a2
commit
6be9710a34
19
jsde.js
19
jsde.js
|
@ -64,16 +64,29 @@ function JsdeWindow(options)
|
|||
$(this._inner).data("jsde-window", this)
|
||||
$(this._title).data("jsde-window", this)
|
||||
|
||||
$(this._outer).find(".window-close a").click(this._HandleClose);
|
||||
|
||||
this.BringToForeground();
|
||||
}
|
||||
|
||||
JsdeWindow.prototype.BringToForeground = function()
|
||||
{
|
||||
this.z = next_z_index;
|
||||
$(this._outer).css({"z-index": next_z_index})
|
||||
next_z_index++;
|
||||
return this;
|
||||
}
|
||||
|
||||
JsdeWindow.prototype.Close = function(forced)
|
||||
{
|
||||
if(typeof forced === "undefined")
|
||||
{
|
||||
forced = false;
|
||||
}
|
||||
|
||||
$(this._outer).remove();
|
||||
}
|
||||
|
||||
JsdeWindow.prototype.GetContents = function()
|
||||
{
|
||||
return $(this._inner).html();
|
||||
|
@ -143,6 +156,12 @@ JsdeWindow.prototype._HandleMouseDown = function(event)
|
|||
event.stopPropagation();
|
||||
}
|
||||
|
||||
JsdeWindow.prototype._HandleClose = function(event)
|
||||
{
|
||||
affected_window = $(this).closest(".window-title").data("jsde-window");
|
||||
affected_window.Close();
|
||||
}
|
||||
|
||||
function _HandleMouseUp(event)
|
||||
{
|
||||
if(currently_dragging === true)
|
||||
|
|
Loading…
Reference in a new issue