summaryrefslogtreecommitdiff
path: root/print/resources/inkstitch.js
diff options
context:
space:
mode:
Diffstat (limited to 'print/resources/inkstitch.js')
-rw-r--r--print/resources/inkstitch.js22
1 files changed, 21 insertions, 1 deletions
diff --git a/print/resources/inkstitch.js b/print/resources/inkstitch.js
index 4a4e4456..60d17f61 100644
--- a/print/resources/inkstitch.js
+++ b/print/resources/inkstitch.js
@@ -154,7 +154,7 @@ $(function() {
$('[contenteditable="true"]').on('focusout', function() {
/* change svg scale */
- var content = $.trim($(this).text());
+ var content = $(this).html();
var field_name = $(this).attr('data-field-name');
if(field_name == 'svg-scale') {
var scale = parseInt(content);
@@ -255,6 +255,26 @@ $(function() {
$.postJSON('/settings/paper-size', {value: size});
});
+ // Thread Palette
+ $('select#thread-palette').change(function(){
+ $('.modal').show();
+ }).on('update', function() {
+ $(this).data('current-value', $(this).find(':selected').val());
+ console.log("selected: " + $(this).data('current-value'));
+ }).trigger('update');
+
+ $('#modal-yes').on('click', function(){
+ // do shit with the newly-selected palette...
+ $("select#thread-palette").trigger("update");
+ $('.modal').hide();
+ });
+
+ $('#modal-no').on('click', function(){
+ var select = $("select#thread-palette");
+ select.find('[value="' + select.data('current-value') + '"]').prop('selected', true);
+ $('.modal').hide();
+ });
+
//Checkbox
$(':checkbox').change(function() {
var checked = $(this).prop('checked');