瀏覽代碼

Made percent value edition more intuitive

Clement Espeute 2 年之前
父節點
當前提交
bc3d8d4029
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5 1
      hide/comp/cdb/Cell.hx

+ 5 - 1
hide/comp/cdb/Cell.hx

@@ -674,7 +674,8 @@ class Cell {
 		case TString if( column.kind == Script ):
 			open();
 		case TInt, TFloat, TString, TId, TCustom(_), TDynamic:
-			var str = value == null ? "" : Std.isOfType(value, String) ? value : editor.base.valToString(column.type, value);
+			var isPercent = column.display == Percent;
+			var str = value == null ? "" : Std.isOfType(value, String) ? value : editor.base.valToString(column.type, value, false, isPercent);
 
 			elementHtml.innerHTML = null;
 			elementHtml.classList.add("edit");
@@ -1154,6 +1155,9 @@ class Cell {
 		} else
 			newValue = str;
 
+		if (column.display == Percent)
+			newValue *= 0.01;
+
 		if( newValue == null || newValue == currentValue )
 			return;