Publish Vulpes Preview 15 sources for desktop, Android and Tundra
Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
This commit is contained in:
parent
93e3a48004
commit
b38dea0597
25901 changed files with 9982925 additions and 369 deletions
35
gaia/dev_apps/uitest/js/UI/window_open.js
Executable file
35
gaia/dev_apps/uitest/js/UI/window_open.js
Executable file
|
|
@ -0,0 +1,35 @@
|
|||
'use strict';
|
||||
|
||||
window.addEventListener('load', function() {
|
||||
var popup = null;
|
||||
var buttons = document.querySelectorAll('button');
|
||||
|
||||
for (var i = 0; i < buttons.length; i++) {
|
||||
var button = buttons[i];
|
||||
button.addEventListener('click', function(e) {
|
||||
var target = e.target;
|
||||
var actualWindow = window;
|
||||
if (target.classList.contains('mozbrowser')) {
|
||||
actualWindow = window.parent;
|
||||
}
|
||||
|
||||
switch (target.dataset.action) {
|
||||
case 'open':
|
||||
var param1 = null,
|
||||
param2 = null;
|
||||
var hash = target.dataset.url.split('#');
|
||||
if (hash.length > 1) {
|
||||
param1 = hash[1];
|
||||
param2 = hash[1];
|
||||
}
|
||||
popup = actualWindow.open(target.dataset.url, param1, param2);
|
||||
break;
|
||||
case 'close':
|
||||
popup.close();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
Loading…
Reference in a new issue