Skip to content

Commit e7103b5

Browse files
committed
draggable transforms cross browser
1 parent 74c4843 commit e7103b5

File tree

2 files changed

+38
-20
lines changed

2 files changed

+38
-20
lines changed

core/static/core/combine.css

+22-4
Original file line numberDiff line numberDiff line change
@@ -275,27 +275,45 @@ div.grayed_dt_row, td.grayed_dt_row {
275275
}
276276

277277
/* Transform Dragging */
278-
.draggable_button {
278+
.draggable_span {
279279
margin-top: 2px;
280280
margin-bottom: 2px;
281281
}
282282

283283
.draggable_ul {
284284
min-height: 75px;
285285
border-radius: 4px;
286-
padding: 15px;
286+
padding: 5px;
287287
list-style-type: none;
288288
cursor: move;
289289
background-color:#f5f5f5;
290290
}
291291

292-
.draggable_ul button {
292+
.draggable_ul li {
293293
cursor: move;
294+
margin:5px;
295+
padding:5px;
296+
}
297+
298+
.draggable_ul li span {
299+
margin:.5rem;
300+
padding: .25rem .5rem;
301+
font-size: .875rem;
302+
line-height: 1.5;
303+
border-radius: .2rem;
304+
border: 1px solid #17a2b8;
305+
color: #17a2b8;
306+
}
307+
308+
.draggable_ul li span:hover {
309+
color: white;
310+
background-color: #17a2b8;
294311
}
295312

296313
.ph-class {
297-
border: 1px solid #343a40;
314+
/*border: 1px solid #343a40;*/
298315
background-color: white;
316+
padding: 5px;
299317
}
300318

301319

core/templates/core/job_transform.html

+16-16
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ <h3>New Job: <span class="font-weight-bold">Transform Document</span></h3>
1313
<form id="job_init_form" method="POST" action="{% url 'job_transform' org_id=record_group.organization.id record_group_id=record_group.id %}">
1414

1515
{% csrf_token %}
16-
16+
1717
<div class="row">
1818
<div class="col-md-12">
1919
<!-- optional job details -->
@@ -51,7 +51,7 @@ <h3>New Job: <span class="font-weight-bold">Transform Document</span></h3>
5151

5252
<div class="row">
5353
<div class="col-md-12">
54-
54+
5555
<div class="alert alert-danger alert-dismissible fade show" role="alert">
5656
The following are <strong>required</strong> parameters for this Job
5757
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
@@ -78,7 +78,7 @@ <h4>Select Transformation Scenarios</h4>
7878
<h6>Available Transformations</h6>
7979
<ul class="draggable_ul available_transforms">
8080
{% for transformation in transformations %}
81-
<li data-trans_id={{transformation.id}} ><button class="draggable_button btn-outline-primary btn-sm">{{transformation.name}}</button></li>
81+
<li data-trans_id={{transformation.id}} ><span class="draggable_span">{{transformation.name}}</span></li>
8282
{% endfor %}
8383
</ul>
8484
</div>
@@ -93,26 +93,26 @@ <h6>Selected Transformations</h6>
9393
<script>
9494

9595
// init available transforms
96-
var available = sortable('.available_transforms', {
97-
acceptFrom: ".selected_transforms, .available_transforms",
96+
var available = sortable('.available_transforms', {
97+
acceptFrom: ".selected_transforms, .available_transforms",
9898
items:'li',
9999
forcePlaceholderSize: true,
100-
placeholderClass: 'ph-class',
100+
placeholderClass: 'ph-class',
101101
});
102102

103103
// init selected transforms
104-
var selected = sortable('.selected_transforms', {
105-
acceptFrom: ".available_transforms, .selected_transforms",
104+
var selected = sortable('.selected_transforms', {
105+
acceptFrom: ".available_transforms, .selected_transforms",
106106
items:'li',
107107
forcePlaceholderSize: true,
108-
placeholderClass: 'ph-class',
108+
placeholderClass: 'ph-class',
109109
});
110110

111-
111+
112112
function ser_sel_trans(){
113113

114114
/*
115-
Function to serialize and capture ordered transformation ids
115+
Function to serialize and capture ordered transformation ids
116116
117117
Args:
118118
None
@@ -124,7 +124,7 @@ <h6>Selected Transformations</h6>
124124

125125
sel_trans_obj = [];
126126

127-
// serialize
127+
// serialize
128128
sel_trans = sortable('.selected_transforms', 'serialize')[0];
129129

130130
// loop
@@ -133,7 +133,7 @@ <h6>Selected Transformations</h6>
133133
sel_trans_obj.push({
134134
'index':trans.index,
135135
'trans_id':parseInt(trans.node.attributes['data-trans_id'].value)
136-
})
136+
})
137137
}
138138

139139
// debug
@@ -154,7 +154,7 @@ <h6>Selected Transformations</h6>
154154

155155
// set hidden input with serialized JSON
156156
sel_trans_json = JSON.stringify(sel_trans_obj)
157-
$("#sel_trans_json").val(sel_trans_json);
157+
$("#sel_trans_json").val(sel_trans_json);
158158

159159
});
160160

@@ -165,14 +165,14 @@ <h6>Selected Transformations</h6>
165165

166166
<!-- Optional Job Processing -->
167167
{% include 'core/job_optional_processing.html' %}
168-
168+
169169
<button type="submit" class="btn btn-success btn-sm">Run Transform Job <i class="la la-play"></i></button>
170170

171171
</form>
172172

173173
<!-- Modals -->
174174
{% include 'core/job_spec_input_filters.html' %}
175-
175+
176176
</div>
177177
</div>
178178

0 commit comments

Comments
 (0)