@@ -9,7 +9,8 @@ define(["iter2d", "csshelper"], function(iter2d, csshelper){
9
9
cell = { } ;
10
10
11
11
cell . canvasAnim = makeCanvasAnimation ( context , animationCode ) ;
12
- cell . hint = makeHint ( row , col , height , width ) ;
12
+ cell . hint = createCellDiv ( "hint" , row , col , height , width ) ;
13
+ cell . ui = makeCellUi ( row , col , height , width ) ;
13
14
14
15
return cell ;
15
16
} ;
@@ -36,7 +37,7 @@ define(["iter2d", "csshelper"], function(iter2d, csshelper){
36
37
return ;
37
38
}
38
39
39
- // force reset matrix
40
+ // force reset matrix/
40
41
context . setTransform ( 1 , 0 , 0 , 1 , 0 , 0 ) ;
41
42
this . currentAnimation . draw ( context , borders , this . lib ) ;
42
43
} ,
@@ -76,17 +77,34 @@ define(["iter2d", "csshelper"], function(iter2d, csshelper){
76
77
return canvas ;
77
78
} ;
78
79
79
- var makeHint = function ( row , col , height , width ) {
80
- var gridHint = document . createElement ( 'div' ) ;
81
- gridHint . id = "hint -" + row + "-" + col ;
82
- gridHint . className = "hint" ;
83
- gridHint . style . top = ( height * row ) + "px" ;
84
- gridHint . style . left = ( width * col ) + "px" ;
85
-
86
- document . getElementById ( 'dashboard' ) . appendChild ( gridHint ) ;
87
- return gridHint ;
80
+ var createCellDiv = function ( className , row , col , height , width ) {
81
+ var cellDiv = document . createElement ( 'div' ) ;
82
+ cellDiv . id = className + " -" + row + "-" + col ;
83
+ cellDiv . className = className ;
84
+ cellDiv . style . top = ( height * row ) + "px" ;
85
+ cellDiv . style . left = ( width * col ) + "px" ;
86
+
87
+ document . getElementById ( 'dashboard' ) . appendChild ( cellDiv ) ;
88
+ return cellDiv ;
88
89
} ;
89
90
91
+
92
+ var makeIcon = function ( classNames ) {
93
+ var icon = document . createElement ( 'span' ) ;
94
+ icon . className = classNames ;
95
+ return icon ;
96
+ } ;
97
+
98
+ var makeCellUi = function ( row , col , height , width ) {
99
+ var cellUi = createCellDiv ( "cellUi" , row , col , height , width ) ;
100
+
101
+ var edit = makeIcon ( "fa fa-pencil-square-o fa-2x" ) ;
102
+ var loadAnimation = makeIcon ( "fa fa-folder-open-o fa-2x" ) ;
103
+
104
+ cellUi . appendChild ( loadAnimation ) ;
105
+ cellUi . appendChild ( edit ) ;
106
+ } ;
107
+
90
108
var addHintListeners = function ( cells ) {
91
109
var showGridHint = function ( show ) {
92
110
0 commit comments