Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

* Upgraded javascript to be compatible with mootools 1.3 #10

Open
wants to merge 1 commit into from

1 participant

@kalleth

This should update the 'Core' section of the javascript to use Mootools 1.3. I'm also using the Checkbox from More and that seems to have no issues that need changing.

Rest of the 'More' stuff will need changing as similar.

NB: This commit will cause breakages if used with 1.2, I'm not sure how to code around this.

@kalleth

Hmm, looks like I should have asked to merge into 1.3 branch or master, which still doesn't contain these changes as far as I can see, but I checked and modded the 1.2 branch rather than the 1.3. Ho hum, that's me being silly with git. Will fix later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 10, 2011
  1. @kalleth
This page is out of date. Refresh to see the latest.
View
6 Source/Core/Mif.Tree.Draw.js
@@ -17,7 +17,7 @@ Mif.Tree.Draw = {
getHTML: function(node,html){
var prefix = node.tree.DOMidPrefix;
var checkbox;
- if($defined(node.state.checked)){
+ if(node.state.checked != null){
if(!node.hasCheckbox) node.state.checked='nochecked';
checkbox = '<span class="mif-tree-checkbox mif-tree-node-'+node.state.checked+'" uid="'+node.UID+'">'+Mif.Tree.Draw.zeroSpace+'</span>';
}else{
@@ -59,7 +59,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);
},
@@ -119,5 +119,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
@@ -47,7 +47,7 @@ Mif.Tree.implement({
load: function(options){
var tree = this;
- this.loadOptions = this.loadOptions||$lambda({});
+ this.loadOptions = this.loadOptions||Function.from({});
function success(json){
var parent = null;
if(tree.forest){
@@ -63,8 +63,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'
@@ -93,8 +93,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){
@@ -324,4 +324,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.6.4',
- Implements: [new Events, new Options],
+ Implements: [Events, Options],
options:{
types: {},
@@ -36,7 +36,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,
@@ -62,7 +62,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.events();
this.initScroll();
this.initSelection();
Something went wrong with that request. Please try again.