Overview
Comment:Set 'Escape' key to close any iframe dialog
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | dev
Files: files | file ages | folders
SHA1: 232c3fc1351c86a83f49cb35f66995f6392a0cb5
User & Date: bohwaz on 2020-11-07 16:39:40
Other Links: branch diff | manifest | tags
Context
2020-11-07
16:48
Make sure either both id_year and id_account are null, or both of them are filled check-in: 5ffcc01335 user: bohwaz tags: dev
16:39
Set 'Escape' key to close any iframe dialog check-in: 232c3fc135 user: bohwaz tags: dev
16:34
Add Escape key to close dialog check-in: 0f3aa7ac91 user: bohwaz tags: dev
Changes

Modified src/templates/admin/membres/selector.tpl from [2331247a49] to [1b73c5c74d].

49
50
51
52
53
54
55
56
57
58
59
60
		}

		e.querySelector('button').click();
	};
});

document.querySelector('input').focus();
window.onkeyup = (e) => { if (e.key == 'Escape') window.parent.g.closeDialog(); };
</script>
{/literal}

{include file="admin/_foot.tpl"}







<




49
50
51
52
53
54
55

56
57
58
59
		}

		e.querySelector('button').click();
	};
});

document.querySelector('input').focus();

</script>
{/literal}

{include file="admin/_foot.tpl"}

Modified src/www/admin/static/scripts/global.js from [783c67bc7d] to [4d73132811].

114
115
116
117
118
119
120

121
122
123
124
125
126
127
	g.openFrameDialog = function (url) {
		var iframe = document.createElement('iframe');
		iframe.src = url;
		iframe.name = 'dialog';
		iframe.frameborder = '0';
		iframe.scrolling = 'yes';
		iframe.width = iframe.height = 0;


		g.openDialog(iframe);
	};

	g.closeDialog = function () {
		if (null === g.dialog) {
			return;







>







114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
	g.openFrameDialog = function (url) {
		var iframe = document.createElement('iframe');
		iframe.src = url;
		iframe.name = 'dialog';
		iframe.frameborder = '0';
		iframe.scrolling = 'yes';
		iframe.width = iframe.height = 0;
		iframe.onload = () => { iframe.contentWindow.onkeyup = (e) => { if (e.key == 'Escape') g.closeDialog(); };}

		g.openDialog(iframe);
	};

	g.closeDialog = function () {
		if (null === g.dialog) {
			return;