mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-09-12 07:10:07 +02:00
Fix workspace.
This commit is contained in:
parent
cb2d63de6a
commit
18d956fa08
@ -1,57 +1,53 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright [2012] [wisemapping]
|
* Copyright [2012] [wisemapping]
|
||||||
*
|
*
|
||||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||||
* "powered by wisemapping" text requirement on every single page;
|
* "powered by wisemapping" text requirement on every single page;
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the license at
|
* You may obtain a copy of the license at
|
||||||
*
|
*
|
||||||
* http://www.wisemapping.org/license
|
* http://www.wisemapping.org/license
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Grid = function(parent, colums, rows)
|
Grid = function (parent, colums, rows) {
|
||||||
{
|
|
||||||
var cellSize = "10px";
|
var cellSize = "10px";
|
||||||
this._parent = parent;
|
this._parent = parent;
|
||||||
this._container = this._createContainer();
|
this._container = this._createContainer();
|
||||||
var tbody = this._container.firstChild.firstChild;
|
var tbody = $(this._container.firstChild.firstChild);
|
||||||
for (var i = 0; i < rows; i++)
|
for (var i = 0; i < rows; i++) {
|
||||||
{
|
var trElement = $('<tr></tr>');
|
||||||
var trElement = document.createElement("tr");
|
for (var j = 0; j < colums; j++) {
|
||||||
for (var j = 0; j < colums; j++)
|
var tdElement = $('<td></td>');
|
||||||
{
|
tdElement.css({
|
||||||
var tdElement = document.createElement("td");
|
width: cellSize,
|
||||||
tdElement.style.width = cellSize;
|
height: cellSize,
|
||||||
tdElement.style.height = cellSize;
|
borderWidth: "1px",
|
||||||
tdElement.style.borderWidth = "1px";
|
borderStyle: "dashed",
|
||||||
tdElement.style.borderStyle = "dashed";
|
borderColor: "lightsteelblue"}
|
||||||
tdElement.style.borderColor = "lightsteelblue";
|
);
|
||||||
trElement.append(tdElement);
|
trElement.append(tdElement);
|
||||||
}
|
}
|
||||||
tbody.append(trElement);
|
tbody.append(trElement);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Grid.prototype.setPosition = function(x, y)
|
Grid.prototype.setPosition = function (x, y) {
|
||||||
{
|
|
||||||
this._container.style.left = x;
|
this._container.style.left = x;
|
||||||
this._container.style.top = y;
|
this._container.style.top = y;
|
||||||
};
|
};
|
||||||
|
|
||||||
Grid.prototype.render = function()
|
Grid.prototype.render = function () {
|
||||||
{
|
$(this._parent).append(this._container);
|
||||||
this._parent.append(this._container);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Grid.prototype._createContainer = function()
|
Grid.prototype._createContainer = function () {
|
||||||
{
|
|
||||||
var result = window.document.createElement("div");
|
var result = window.document.createElement("div");
|
||||||
result.style.tableLayout = "fixed";
|
result.style.tableLayout = "fixed";
|
||||||
result.style.borderCollapse = "collapse";
|
result.style.borderCollapse = "collapse";
|
||||||
|
@ -73,7 +73,7 @@
|
|||||||
var x = 100;
|
var x = 100;
|
||||||
var executer = function () {
|
var executer = function () {
|
||||||
x = (x + 10) % 100;
|
x = (x + 10) % 100;
|
||||||
divElem.style.left = x + "px";
|
divElem.css('left', x + "px");
|
||||||
};
|
};
|
||||||
executer.periodical(100);
|
executer.periodical(100);
|
||||||
|
|
||||||
@ -136,13 +136,13 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
var workspace100x100 = coordSizeSampleBuilder(100, 100);
|
var workspace100x100 = coordSizeSampleBuilder(100, 100);
|
||||||
workspace100x100.addItAsChildTo(document.id("coordsizeExample100x100"));
|
workspace100x100.addItAsChildTo($("#coordsizeExample100x100"));
|
||||||
|
|
||||||
var workspace100x200 = coordSizeSampleBuilder(100, 200);
|
var workspace100x200 = coordSizeSampleBuilder(100, 200);
|
||||||
workspace100x200.addItAsChildTo(document.id("coordsizeExample100x200"));
|
workspace100x200.addItAsChildTo($("#coordsizeExample100x200"));
|
||||||
|
|
||||||
var workspace200x100 = coordSizeSampleBuilder(200, 100);
|
var workspace200x100 = coordSizeSampleBuilder(200, 100);
|
||||||
workspace200x100.addItAsChildTo(document.id("coordsizeExample200x100"));
|
workspace200x100.addItAsChildTo($("#coordsizeExample200x100"));
|
||||||
|
|
||||||
var dynamicWorkspace = coordSizeSampleBuilder(100, 100);
|
var dynamicWorkspace = coordSizeSampleBuilder(100, 100);
|
||||||
dynamicWorkspace.addItAsChildTo($('#coordsizeExampleDynamic'));
|
dynamicWorkspace.addItAsChildTo($('#coordsizeExampleDynamic'));
|
||||||
@ -200,13 +200,13 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
var workspace0x0 = coordOriginSampleBuilder(0, 0);
|
var workspace0x0 = coordOriginSampleBuilder(0, 0);
|
||||||
workspace0x0.addItAsChildTo(document.id("coordorigin0x0"));
|
workspace0x0.addItAsChildTo($("#coordorigin0x0"));
|
||||||
|
|
||||||
var workspace0x50 = coordOriginSampleBuilder(0, 50);
|
var workspace0x50 = coordOriginSampleBuilder(0, 50);
|
||||||
workspace0x50.addItAsChildTo(document.id("coordorigin0x50"));
|
workspace0x50.addItAsChildTo($("#coordorigin0x50"));
|
||||||
|
|
||||||
var workspace50x0 = coordOriginSampleBuilder(50, 0);
|
var workspace50x0 = coordOriginSampleBuilder(50, 0);
|
||||||
workspace50x0.addItAsChildTo(document.id("coordorigin50x0"));
|
workspace50x0.addItAsChildTo($("#coordorigin50x0"));
|
||||||
|
|
||||||
// Workspace animation changing the coordsize from (30,30) to (100,100)
|
// Workspace animation changing the coordsize from (30,30) to (100,100)
|
||||||
var dynamicWorkspace = coordOriginSampleBuilder(100, 100);
|
var dynamicWorkspace = coordOriginSampleBuilder(100, 100);
|
||||||
|
Loading…
Reference in New Issue
Block a user