aboutsummaryrefslogtreecommitdiff
path: root/static/js/wpaint/bai.js
blob: ef93e025115066f9657c79e9966f7a70475fbf5a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
function saveImg(image) {
  var _this = this;
  var url = document.getElementById('finish').href;
  var save_url = document.getElementById('wPaint').dataset.save;
  
  $.ajax({
    type: 'POST',
    url: save_url,
    data: {image: image},
    success: function (resp) {
      _this._displayStatus('Image saved successfully');
      window.location.href = url;
    }
  });
}

$('#wPaint').wPaint({
  path: '/static/js/wpaint/',
  bg: '#ffffff',
  menuOffsetLeft: -35,
  menuOffsetTop: -50,
  menuOrientation: 'horizontal',
  saveImg: saveImg
});