Changeset 0500480 in prototipo_portal_2018 for prototipo/static/js/docsDraggable.js
- Timestamp:
- Oct 25, 2017, 2:00:40 PM (7 years ago)
- Branches:
- master
- Children:
- 445bdb4
- Parents:
- 307a8cc
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
prototipo/static/js/docsDraggable.js
ra9c1355 r0500480 8 8 __CANVAS_CTX = __CANVAS.getContext('2d'), 9 9 __id = "", 10 __NUMBER = 0; 10 __NUMBER = 0, 11 __CLICK = 0; 11 12 12 13 $("#pdf-canvas2").hide(); … … 87 88 88 89 $("#container1").attr("style", "background-image: url('"+__id+"');background-size: cover; background-repeat: no-repeat; height:"+viewdimen.height+"px; width:"+viewdimen.width+"px"); 89 $("#container1").attr("style", "background-image: url('"+__id+"');background-size: cover; background-repeat: no-repeat; height:"+(viewdimen.height)+"px; width:"+(viewdimen.width)+"px"); 90 90 91 91 92 92 }); … … 118 118 } 119 119 120 121 120 // Send the object url of the pdf 122 121 showPDF2(URL.createObjectURL($("#file-to-upload2").get(0).files[0])); 122 123 if (__CLICK == 0){ 124 $('#firmar-documento').attr("disabled","disabled").show(); 125 $('#texto').show(); 126 __CLICK += 1; 127 } 123 128 124 129 }); … … 141 146 142 147 143 var transferred = false;144 $('.text').draggable({145 connectToSortable: $('#container1'),146 helper: 'clone',147 start: function(event, ui)148 {149 $(this).hide();150 },151 stop: function(event, ui)152 {153 154 if(!transferred) {155 $(this).show();156 }157 else{158 159 $(this).remove();160 transferred = false;161 }162 }163 });164 165 166 function InicializarObjectoPositicion(){167 var container = document.getElementById('container1'),168 element = document.getElementsByClassName('text')[0];169 170 // options171 var options = {172 limit: container,173 setCursor: true174 };175 176 // initialize drag177 new Draggable(element, options);178 179 }180 181 182 function NuevoObjectoInicial(){183 184 var num = 0;185 $( ".text" ).draggable({186 containment: '#container1',187 scroll: false,188 stop: function(event, ui)189 {190 191 num+= 1;192 if (num == 1){193 $("#firma_visible #Formato_Visible .text").hide();194 $('#dataX').val(0);195 $('#dataY').val(0);196 }else{197 $('#dataX').val(ui.position['left']);198 $('#dataY').val(ui.position['top']);199 }200 201 },202 203 });204 }205 206 $('#container1').sortable({207 receive: function(event, ui)208 {209 210 transferred = true;211 InicializarObjectoPositicion()212 NuevoObjectoInicial();213 214 215 }216 });
Note: See TracChangeset
for help on using the changeset viewer.