view inkscape/firefox/content/themes/checkbox/change.js @ 1433:7bd6c0e88ec8

Fix issue of showing image incorrectly. - It is discussed in ticket #23 that objects are refreshed partially. - It is actually only for image since multiple image share a image paint, it will modify sampling matrix when they transforming. Values of later ones would over-write eariler ones. - It is fixed by move matrix setting until drawing.
author Thinker K.F. Li <thinker@codemud.net>
date Mon, 11 Apr 2011 12:45:20 +0800
parents 4350aa369149
children
line wrap: on
line source

onchange : function (NODE, TREE_OBJ) { 
  var $this = $(NODE).is("li") ? $(NODE) : $(NODE).parent();
  if($this.children("a.unchecked").size() == 0) {
    TREE_OBJ.container.find("a").addClass("unchecked");
  }
  $this.children("a").removeClass("clicked");
  if($this.children("a").hasClass("checked")) {
    $this.find("li").andSelf().children("a").removeClass("checked").removeClass("undetermined").addClass("unchecked");
    var state = 0;
  }
  else {
    $this.find("li").andSelf().children("a").removeClass("unchecked").removeClass("undetermined").addClass("checked");
    var state = 1;
  }
  $this.parents("li").each(function () { 
    if(state == 1) {
      if($(this).find("a.unchecked, a.undetermined").size() - 1 > 0) {
        $(this).parents("li").andSelf().children("a").removeClass("unchecked").removeClass("checked").addClass("undetermined");
        return false;
      }
      else $(this).children("a").removeClass("unchecked").removeClass("undetermined").addClass("checked");
    }
    else {
      if($(this).find("a.checked, a.undetermined").size() - 1 > 0) {
        $(this).parents("li").andSelf().children("a").removeClass("unchecked").removeClass("checked").addClass("undetermined");
        return false;
      }
      else $(this).children("a").removeClass("checked").removeClass("undetermined").addClass("unchecked");
    }
  });
}