corrade-nucleus-nucleons

Subversion Repositories:
Compare Path: Rev
With Path: Rev
?path1? @ 42  →  ?path2? @ 43
/base/000_base/js/wm/wm.js
@@ -91,8 +91,7 @@
var x = states[nucleon].x,
y = states[nucleon].y,
wm = $(data).find('.window-manager-window').get(0);
if(typeof wm !== 'undefined') {
wm.style.webkitTransform =
wm.style.transform =
'translate(' + x + 'px, ' + y + 'px)';
@@ -100,7 +99,6 @@
// Update the position attributes
wm.setAttribute('data-x', x);
wm.setAttribute('data-y', y);
}
}
}
$(data).hide().appendTo('#window-manager-desktop').fadeIn(750);
@@ -142,21 +140,6 @@
onmove: dragMoveListener,
onend: function (event) {
event.target.style.opacity = 1;
// Save the window position.
var states = {};
var cookie = Cookies.get('window-manager-windows');
if(cookie)
states = JSON.parse(cookie);
$('.window-manager-window').each(function(i, wm) {
states[$(wm).data('target')] = {
x: $(wm).data('x'),
y: $(wm).data('y')
};
});
 
Cookies.set('window-manager-windows', states, { path: '' });
},
onstart: function(event) {
// Move windows to top on drag.
@@ -190,21 +173,6 @@
onmove: dragMoveListener,
onend: function (event) {
event.target.style.opacity = 1;
// Save the icon position.
var states = {};
var cookie = Cookies.get('window-manager-icons');
if(cookie)
states = JSON.parse(cookie);
$('.window-manager-icon').each(function(i, wm) {
states[$(wm).data('target')] = {
x: $(wm).data('x'),
y: $(wm).data('y')
};
});
Cookies.set('window-manager-icons', states, { path: '' });
},
onstart: function(event) {
event.target.style.opacity = 0.5;
@@ -240,6 +208,36 @@
// update the position attributes
target.setAttribute('data-x', x);
target.setAttribute('data-y', y);
if(target.classList.contains('window-manager-window')) {
// Save the window position.
var states = {};
var cookie = Cookies.get('window-manager-windows');
if(cookie)
states = JSON.parse(cookie);
states[$(event.target).data('target')] = {
x: x,
y: y
};
Cookies.set('window-manager-windows', states, { path: '' });
}
if(target.classList.contains('window-manager-icon')) {
// Save the icon position.
var states = {};
var cookie = Cookies.get('window-manager-icons');
if(cookie)
states = JSON.parse(cookie);
states[$(event.target).data('target')] = {
x: x,
y: y
};
Cookies.set('window-manager-icons', states, { path: '' });
}
}
 
// this is used later in the resizing and gesture demos