From b5ae905aeebee068cea708b2c4df4b927326b57b Mon Sep 17 00:00:00 2001 From: oranges Date: Wed, 6 Jul 2016 12:11:25 +1200 Subject: [PATCH] Revert "tgui modifications for custom browser id" (#19151) --- code/modules/tgui/tgui.dm | 24 ++++++++---------------- tgui/src/components/button.ract | 2 -- tgui/src/components/titlebar.ract | 20 +++++++++----------- tgui/src/tgui.ract | 4 +--- 4 files changed, 18 insertions(+), 32 deletions(-) diff --git a/code/modules/tgui/tgui.dm b/code/modules/tgui/tgui.dm index 273841b7872..43b625a4152 100644 --- a/code/modules/tgui/tgui.dm +++ b/code/modules/tgui/tgui.dm @@ -33,8 +33,6 @@ var/datum/ui_state/state = null // Topic state used to determine status/interactability. var/datum/tgui/master_ui // The parent UI. var/list/datum/tgui/children = list() // Children of this UI. - var/titlebar = TRUE - var/custom_browser_id = FALSE /** * public @@ -53,12 +51,11 @@ * * return datum/tgui The requested UI. **/ -/datum/tgui/New(mob/user, datum/src_object, ui_key, interface, title, width = 0, height = 0, datum/tgui/master_ui = null, datum/ui_state/state = default_state, browser_id) +/datum/tgui/New(mob/user, datum/src_object, ui_key, interface, title, width = 0, height = 0, datum/tgui/master_ui = null, datum/ui_state/state = default_state) src.user = user src.src_object = src_object src.ui_key = ui_key - src.window_id = browser_id ? browser_id : "\ref[src_object]-[ui_key]" - src.custom_browser_id = browser_id ? TRUE : FALSE + src.window_id = "\ref[src_object]-[ui_key]" set_interface(interface) @@ -99,8 +96,7 @@ var/debugable = check_rights_for(user.client, R_DEBUG) user << browse(get_html(debugable), "window=[window_id];[window_size][list2params(window_options)]") // Open the window. - if (custom_browser_id) - winset(user, window_id, "on-close=\"uiclose \ref[src]\"") // Instruct the client to signal UI when the window is closed. + winset(user, window_id, "on-close=\"uiclose \ref[src]\"") // Instruct the client to signal UI when the window is closed. SStgui.on_open(src) /** @@ -220,7 +216,7 @@ "style" = style, "interface" = interface, "fancy" = user.client.prefs.tgui_fancy, - "locked" = user.client.prefs.tgui_lock && !custom_browser_id, + "locked" = user.client.prefs.tgui_lock, "window" = window_id, "ref" = "\ref[src]", "user" = list( @@ -230,8 +226,7 @@ "srcObject" = list( "name" = "[src_object]", "ref" = "\ref[src_object]" - ), - "titlebar" = titlebar + ) ) return config_data @@ -273,7 +268,7 @@ switch(action) if("tgui:initialize") - user << output(url_encode(get_json(initial_data)), "[custom_browser_id ? window_id : "[window_id].browser"]:initialize") + user << output(url_encode(get_json(initial_data)), "[window_id].browser:initialize") initialized = TRUE if("tgui:view") if(params["screen"]) @@ -325,7 +320,7 @@ return // Cannot update UI, we have no visibility. // Send the new JSON to the update() Javascript function. - user << output(url_encode(get_json(data)), "[custom_browser_id ? window_id : "[window_id].browser"]:update") + user << output(url_encode(get_json(data)), "[window_id].browser:update") /** * private @@ -371,7 +366,4 @@ else src.status = status if(status == UI_DISABLED || push) // Update if the UI just because disabled, or a push is requested. - push_data(null, force = 1) - -/datum/tgui/proc/set_titlebar(value) - titlebar = value + push_data(null, force = 1) \ No newline at end of file diff --git a/tgui/src/components/button.ract b/tgui/src/components/button.ract index 51d77a1a5d2..e61164160a5 100644 --- a/tgui/src/components/button.ract +++ b/tgui/src/components/button.ract @@ -18,8 +18,6 @@ }, styles () { let extra = '' - if (this.get('class')) - extra += ' ' + this.get('class'); if (this.get('tooltip-side')) extra = ` tooltip-${this.get('tooltip-side')}` if (this.get('grid')) diff --git a/tgui/src/components/titlebar.ract b/tgui/src/components/titlebar.ract index 7ce9d144ae7..a67832cef8c 100644 --- a/tgui/src/components/titlebar.ract +++ b/tgui/src/components/titlebar.ract @@ -19,7 +19,7 @@ component.exports = { const onrelease = (event) => this.set({ drag: false, x: null, y: null }) this.observe('config.fancy', (newkey, oldkey, keypath) => { - winset(this.get('config.window'), 'titlebar', !newkey && this.get('config.titlebar')) + winset(this.get('config.window'), 'titlebar', !newkey) if (newkey) { document.addEventListener('mousemove', ondrag) @@ -46,13 +46,11 @@ component.exports = { } -{{#if config.titlebar}} -
- - {{yield}} - {{#if config.fancy}} - - - {{/if}} -
-{{/if}} +
+ + {{yield}} + {{#if config.fancy}} + + + {{/if}} +
diff --git a/tgui/src/tgui.ract b/tgui/src/tgui.ract index cdd31d3ee83..e5d93aebf8b 100644 --- a/tgui/src/tgui.ract +++ b/tgui/src/tgui.ract @@ -58,6 +58,4 @@ component.exports = { -{{#if config.titlebar}} - -{{/if}} +