nikgoodley-ibboost / aost

Automatically exported from code.google.com/p/aost
0 stars 0 forks source link

Seems the position attribute cannot be removed once selected in TrUMP, Fix in 0.8.0 #116

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The position attribute cannot be removed from the UI even user unchecks it.

Original issue reported on code.google.com by John.Jian.Fang@gmail.com on 23 Feb 2009 at 7:10

GoogleCodeExporter commented 9 years ago
Seems this only happens in Firefox 2 version and does not always behave like 
this.

Original comment by John.Jian.Fang@gmail.com on 23 Feb 2009 at 11:38

GoogleCodeExporter commented 9 years ago

Original comment by John.Jian.Fang@gmail.com on 26 Feb 2009 at 9:49

GoogleCodeExporter commented 9 years ago

Original comment by John.Jian.Fang@gmail.com on 1 Oct 2009 at 7:40

GoogleCodeExporter commented 9 years ago

Original comment by John.Jian.Fang@gmail.com on 5 Oct 2009 at 11:51

GoogleCodeExporter commented 9 years ago

Original comment by John.Jian.Fang@gmail.com on 19 Apr 2010 at 7:19

GoogleCodeExporter commented 9 years ago

Original comment by John.Jian.Fang@gmail.com on 8 May 2010 at 2:00

GoogleCodeExporter commented 9 years ago
Editor.prototype.updateUiObject = function(){
    var uiObject = this.innerTree.uiObjectMap.get(this.currentUid);
    if(uiObject != null){
        logger.debug("Update UI object " + this.currentUid);

        //update UID
        uiObject.setUID(document.getElementById("uid").value);

        //update UI Type
        uiObject.setUiType(document.getElementById("uiType").value);

        //update Group attribute
        if(!document.getElementById("group_Check_Box").disabled){
            uiObject.group = document.getElementById("group_Check_Box").checked;
        }

        //update attributes
        var attrmap = new HashMap();
        attrmap.put("position", null); <--- this line
        var keys = uiObject.node.attributes.keySet();
        for (var i = 0; i < keys.length; i++) {
            var key = keys[i];
            if (key != "tag") {
                //check each attribute, first look at the check box by the name conversion
                var cid = "CID" + key;

//                var elem = $(':checkbox[cid=' + cid + ']')[0];
//                var elem = $('input[name=' + cid + ']')[0];
                var elem = this.getElementsByTagValue("checkbox", "name", cid);
//                var elem = document.getElementById(cid);
                if (elem != null) {
                    //if the attribute is selected
                    if (elem.checked) {
                        //get the id of the value of the attribute
                        var vid = "VID" + key;
//                        var velem = document.getElementById(vid);
//                        var velem = $("textbox[vid="+vid+"]")[0];
//                        var velem = $(':text[vid='+vid+']')[0];
                        var velem = this.getElementsByTagValue("textbox", "name", vid);
                        if(velem != null){
                            var val = velem.value;
                            attrmap.set(key, val);
                        }else{
                            logger.error("Cannot find value node " + vid + " for attribute " + key);
                        }
                    }

                } else {
                    logger.warn("Cannot Find CheckBox " + cid + " for attribute " + key);
                }
            }
        }
        uiObject.updateAttributes(attrmap);

        this.validateUI();
        this.customizeButton();
        this.updateSource();
    }else{
        logger.error("Cannot find UI object " + this.currentUid);
    }
};

Original comment by John.Jian.Fang@gmail.com on 7 Jul 2010 at 4:16