From 1c538bfabc2cd31f27067505f0c3d1a46cba6ef0 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Thu, 9 Jul 2015 22:18:55 -0700 Subject: RT 4.2.11, ticket#13852 --- rt/share/static/js/titlebox-state.js | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 rt/share/static/js/titlebox-state.js (limited to 'rt/share/static/js/titlebox-state.js') diff --git a/rt/share/static/js/titlebox-state.js b/rt/share/static/js/titlebox-state.js new file mode 100644 index 000000000..d4053390b --- /dev/null +++ b/rt/share/static/js/titlebox-state.js @@ -0,0 +1,36 @@ +function createCookie(name,value,days) { + var path = RT.Config.WebPath ? RT.Config.WebPath : "/"; + + if (days) { + var date = new Date(); + date.setTime(date.getTime()+(days*24*60*60*1000)); + var expires = "; expires="+date.toGMTString(); + } + else + expires = ""; + + document.cookie = name+"="+value+expires+"; path="+path; +} + +function loadTitleBoxStates() { + var cookies = document.cookie.split(/;\s*/); + var len = cookies.length; + + for (var i = 0; i < len; i++) { + var c = cookies[i].split('='); + + if (c[0].match(/^TitleBox--/)) { + var e = document.getElementById(c[0]); + if (e) { + var e2 = e.parentNode; + + if (c[1] != 0) { + set_rollup_state(e,e2,'shown'); + } + else { + set_rollup_state(e,e2,'hidden'); + } + } + } + } +} -- cgit v1.2.1