Skip to content

Commit

Permalink
Add Column kind "localizable"
Browse files Browse the repository at this point in the history
  • Loading branch information
pperidont committed Jan 7, 2016
1 parent 7e6b923 commit 15671e4
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
5 changes: 3 additions & 2 deletions bin/castle.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cdb/Data.hx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ typedef Column = {
var typeStr : String;
@:optional var opt : Bool;
@:optional var display : DisplayType;
@:optional var localizable : Bool;
@:optional var kind : String;
}

@:enum abstract LayerMode(String) {
Expand Down
4 changes: 2 additions & 2 deletions src/Main.hx
Original file line number Diff line number Diff line change
Expand Up @@ -1916,7 +1916,7 @@ class Main extends Model {
form.find("[name=type]").val(ref.type.getName().substr(1).toLowerCase()).change();
form.find("[name=req]").prop("checked", !ref.opt);
form.find("[name=display]").val(ref.display == null ? "0" : Std.string(ref.display));
form.find("[name=localizable]").prop("checked", ref.localizable==true);
form.find("[name=localizable]").prop("checked", ref.kind=="localizable");
switch( ref.type ) {
case TEnum(values), TFlags(values):
form.find("[name=values]").val(values.join(","));
Expand Down Expand Up @@ -2079,7 +2079,7 @@ class Main extends Model {
};
if( v.req != "on" ) c.opt = true;
if( v.display != "0" ) c.display = cast Std.parseInt(v.display);
if( v.localizable == "on" ) c.localizable = true;
if( v.localizable == "on" ) c.kind = "localizable";

if( refColumn != null ) {
var err = super.updateColumn(sheet, refColumn, c);
Expand Down
5 changes: 5 additions & 0 deletions src/Model.hx
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,11 @@ class Model {
Reflect.deleteField(old,"display");
else
old.display = c.display;

if( c.kind == null )
Reflect.deleteField(old,"kind");
else
old.kind = c.kind;

makeSheet(sheet);
return null;
Expand Down

0 comments on commit 15671e4

Please sign in to comment.