Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Update javascript to be compatible with mootools 1.3 #11

Open
wants to merge 1 commit into from

1 participant

@kalleth

Basically a duplicate of pull request #10, but to master branch. Feel free to close whichever one you don't want :)

@kalleth

ps. thanks @mjtko for helping me unmessup my git :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
View
6 Source/Core/Mif.Tree.Draw.js
@@ -16,7 +16,7 @@ Mif.Tree.Draw = {
getHTML: function(node,html){
var prefix = node.tree.DOMidPrefix;
- if($defined(node.state.checked)){
+ if(node.state.checked != null){
if(!node.hasCheckbox) node.state.checked='nochecked';
var checkbox = '<span class="mif-tree-checkbox mif-tree-node-'+node.state.checked+'" uid="'+node.UID+'">'+Mif.Tree.Draw.zeroSpace+'</span>';
}else{
@@ -58,7 +58,7 @@ Mif.Tree.Draw = {
},
forestRoot: function(tree){
- var container = new Element('div').addClass('mif-tree-children-root').injectInside(tree.wrapper);
+ var container = new Element('div').addClass('mif-tree-children-root').inject(tree.wrapper, 'inside');
Mif.Tree.Draw.children(tree.root, container);
},
@@ -118,5 +118,5 @@ Mif.Tree.Draw = {
};
-Mif.Tree.Draw.zeroSpace = Browser.Engine.trident ? '&shy;' : (Browser.Engine.webkit ? '&#8203' : '');
+Mif.Tree.Draw.zeroSpace = Browser.ie ? '&shy;' : ((Browser.chrome || Browser.safari) ? '&#8203' : '');
View
6 Source/Core/Mif.Tree.Hover.js
@@ -25,13 +25,13 @@ Mif.Tree.implement({
name: false,
node: false
};
- this.hoverState = $unlink(this.defaultHoverState);
+ this.hoverState = Object.clone(this.defaultHoverState);
},
hover: function(){
var cnode = this.mouse.node;
var ctarget = this.mouse.target;
- $each(this.hoverState, function(node, target, state){
+ Object.each(this.hoverState, function(node, target, state){
if(node == cnode && (target == 'node'||target==ctarget)) return;
if(node) {
Mif.Tree.Hover.out(node, target);
@@ -49,7 +49,7 @@ Mif.Tree.implement({
},
updateHover: function(){
- this.hoverState = $unlink(this.defaultHoverState);
+ this.hoverState = Object.clone(this.defaultHoverState);
this.hover();
}
View
10 Source/Core/Mif.Tree.Load.js
@@ -41,7 +41,7 @@ Mif.Tree.implement({
load: function(options){
var tree = this;
- this.loadOptions = this.loadOptions||$lambda({});
+ this.loadOptions = this.loadOptions||Function.from({});
function success(json){
if(tree.forest){
tree.root = new Mif.Tree.Node({
@@ -58,8 +58,8 @@ Mif.Tree.implement({
tree.fireEvent('load');
return tree;
}
- options = $extend($extend({
- isSuccess: $lambda(true),
+ options = Object.append(Object.append({
+ isSuccess: Function.from(true),
secure: true,
onSuccess: success,
method: 'get'
@@ -88,8 +88,8 @@ Mif.Tree.Node.implement({
self.tree.fireEvent('loadNode', self);
return self;
}
- options=$extend($extend($extend({
- isSuccess: $lambda(true),
+ options=Object.append(Object.append(Object.append({
+ isSuccess: Function.from(true),
secure: true,
onSuccess: success,
method: 'get'
View
16 Source/Core/Mif.Tree.Node.js
@@ -17,12 +17,12 @@ Mif.Tree.Node = new Class({
Implements: [Events],
initialize: function(structure, options) {
- $extend(this, structure);
+ Object.append(this, structure);
this.children = [];
this.type = options.type || this.tree.dfltType;
this.property = options.property || {};
this.data = options.data;
- this.state = $extend($unlink(this.tree.dfltState), options.state);
+ this.state = Object.append(Object.clone(this.tree.dfltState), options.state);
this.$calculate();
this.UID = Mif.Tree.Node.UID++;
Mif.Tree.Nodes[this.UID] = this;
@@ -33,13 +33,13 @@ Mif.Tree.Node = new Class({
},
$calculate: function(){
- $extend(this, $unlink(this.tree.defaults));
- this.type = $splat(this.type);
+ Object.append(this, Object.clone(this.tree.defaults));
+ this.type = Array.from(this.type);
this.type.each(function(type){
var props = this.tree.types[type];
- if(props) $extend(this, props);
+ if(props) Object.append(this, props);
}, this);
- $extend(this, this.property);
+ Object.append(this, this.property);
return this;
},
@@ -92,7 +92,7 @@ Mif.Tree.Node = new Class({
},
recursive: function(fn, args){
- args=$splat(args);
+ args=Array.from(args);
if(fn.apply(this, args) !== false){
this.children.each(function(node){
if(node.recursive(fn, args) === false){
@@ -322,4 +322,4 @@ Mif.Tree.Node = new Class({
});
Mif.Tree.Node.UID = 0;
-Mif.Tree.Nodes = {};
+Mif.Tree.Nodes = {};
View
4 Source/Core/Mif.Tree.Selection.js
@@ -16,7 +16,9 @@ Mif.Tree.implement({
initSelection: function(){
this.defaults.selectClass = '';
- this.wrapper.addEvent('mousedown', this.attachSelect.bindWithEvent(this));
+ this.wrapper.addEvent('mousedown', function(event) {
+ this.attachSelect(event);
+ }.bind(this));
},
attachSelect: function(event){
View
6 Source/Core/Mif.Tree.js
@@ -24,7 +24,7 @@ Mif.Tree = new Class({
version: '1.2.2',
- Implements: [new Events, new Options],
+ Implements: [Events, Options],
options:{
types: {},
@@ -37,7 +37,7 @@ Mif.Tree = new Class({
initialize: function(options){
this.setOptions(options);
- $extend(this, {
+ Object.append(this, {
types: this.options.types,
forest: this.options.forest,
animateScroll: this.options.animateScroll,
@@ -63,7 +63,7 @@ Mif.Tree = new Class({
this.updateOpenState();
if(this.options.expandTo) this.initExpandTo();
this.DOMidPrefix='mif-tree-';
- this.wrapper = new Element('div').addClass('mif-tree-wrapper').injectInside(this.container);
+ this.wrapper = new Element('div').addClass('mif-tree-wrapper').inject(this.container, 'inside');
this.initEvents();
this.initScroll();
this.initSelection();
Something went wrong with that request. Please try again.