summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Lachance <wrlach@gmail.com>2017-07-19 23:07:27 +0200
committerDylan William Hardison <dylan@hardison.net>2017-07-19 23:07:27 +0200
commit4172494434f02d5aaf2254c7aa9a0110d9686ca9 (patch)
treee4f94d052acdb81b1e2342f64985ca9572ff6433
parentd88236d240358a239d3020066cb2a5806fb27e0e (diff)
downloadbugzilla-4172494434f02d5aaf2254c7aa9a0110d9686ca9.tar.gz
bugzilla-4172494434f02d5aaf2254c7aa9a0110d9686ca9.tar.xz
Bug 1380352 - Allow vertical resizing of autosized comments
-rwxr-xr-xextensions/BugModal/web/autosize.min.js5
-rw-r--r--extensions/BugModal/web/bug_modal.css1
2 files changed, 4 insertions, 2 deletions
diff --git a/extensions/BugModal/web/autosize.min.js b/extensions/BugModal/web/autosize.min.js
index 3d8366b57..1a3d04289 100755
--- a/extensions/BugModal/web/autosize.min.js
+++ b/extensions/BugModal/web/autosize.min.js
@@ -1,6 +1,7 @@
/*!
- Autosize 3.0.20
+ Autosize 4.0.0
+ forked with changes from: https://github.com/mozilla-bteam/autosize
license: MIT
http://www.jacklmoore.com/autosize
*/
-!function(e,t){if("function"==typeof define&&define.amd)define(["exports","module"],t);else if("undefined"!=typeof exports&&"undefined"!=typeof module)t(exports,module);else{var n={exports:{}};t(n.exports,n),e.autosize=n.exports}}(this,function(e,t){"use strict";function n(e){function t(){var t=window.getComputedStyle(e,null);"vertical"===t.resize?e.style.resize="none":"both"===t.resize&&(e.style.resize="horizontal"),s="content-box"===t.boxSizing?-(parseFloat(t.paddingTop)+parseFloat(t.paddingBottom)):parseFloat(t.borderTopWidth)+parseFloat(t.borderBottomWidth),isNaN(s)&&(s=0),l()}function n(t){var n=e.style.width;e.style.width="0px",e.offsetWidth,e.style.width=n,e.style.overflowY=t}function o(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push({node:e.parentNode,scrollTop:e.parentNode.scrollTop}),e=e.parentNode;return t}function r(){var t=e.style.height,n=o(e),r=document.documentElement&&document.documentElement.scrollTop;e.style.height="auto";var i=e.scrollHeight+s;return 0===e.scrollHeight?void(e.style.height=t):(e.style.height=i+"px",u=e.clientWidth,n.forEach(function(e){e.node.scrollTop=e.scrollTop}),void(r&&(document.documentElement.scrollTop=r)))}function l(){r();var t=Math.round(parseFloat(e.style.height)),o=window.getComputedStyle(e,null),i=Math.round(parseFloat(o.height));if(i!==t?"visible"!==o.overflowY&&(n("visible"),r(),i=Math.round(parseFloat(window.getComputedStyle(e,null).height))):"hidden"!==o.overflowY&&(n("hidden"),r(),i=Math.round(parseFloat(window.getComputedStyle(e,null).height))),a!==i){a=i;var l=d("autosize:resized");try{e.dispatchEvent(l)}catch(e){}}}if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!i.has(e)){var s=null,u=e.clientWidth,a=null,p=function(){e.clientWidth!==u&&l()},c=function(t){window.removeEventListener("resize",p,!1),e.removeEventListener("input",l,!1),e.removeEventListener("keyup",l,!1),e.removeEventListener("autosize:destroy",c,!1),e.removeEventListener("autosize:update",l,!1),Object.keys(t).forEach(function(n){e.style[n]=t[n]}),i.delete(e)}.bind(e,{height:e.style.height,resize:e.style.resize,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",c,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",l,!1),window.addEventListener("resize",p,!1),e.addEventListener("input",l,!1),e.addEventListener("autosize:update",l,!1),e.style.overflowX="hidden",e.style.wordWrap="break-word",i.set(e,{destroy:c,update:l}),t()}}function o(e){var t=i.get(e);t&&t.destroy()}function r(e){var t=i.get(e);t&&t.update()}var i="function"==typeof Map?new Map:function(){var e=[],t=[];return{has:function(t){return e.indexOf(t)>-1},get:function(n){return t[e.indexOf(n)]},set:function(n,o){e.indexOf(n)===-1&&(e.push(n),t.push(o))},delete:function(n){var o=e.indexOf(n);o>-1&&(e.splice(o,1),t.splice(o,1))}}}(),d=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){d=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}var l=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?(l=function(e){return e},l.destroy=function(e){return e},l.update=function(e){return e}):(l=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],function(e){return n(e,t)}),e},l.destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],o),e},l.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],r),e}),t.exports=l}); \ No newline at end of file
+!function(e,t){if("function"==typeof define&&define.amd)define(["exports","module"],t);else if("undefined"!=typeof exports&&"undefined"!=typeof module)t(exports,module);else{var n={exports:{}};t(n.exports,n),e.autosize=n.exports}}(this,function(e,t){"use strict";function n(e){function t(t){var n=e.style.width;e.style.width="0px",e.offsetWidth,e.style.width=n,e.style.overflowY=t}function n(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push({node:e.parentNode,scrollTop:e.parentNode.scrollTop}),e=e.parentNode;return t}function o(){var t=e.style.height,o=n(e),r=document.documentElement&&document.documentElement.scrollTop;e.style.height="";var i=e.scrollHeight+s;if(0===e.scrollHeight)return void(e.style.height=t);e.style.height=i+"px",u=e.clientWidth,o.forEach(function(e){e.node.scrollTop=e.scrollTop}),r&&(document.documentElement.scrollTop=r)}function r(){o();var n=Math.round(parseFloat(e.style.height)),r=window.getComputedStyle(e,null),i="content-box"===r.boxSizing?Math.round(parseFloat(r.height)):e.offsetHeight;if(i!==n?"hidden"===r.overflowY&&(t("scroll"),o(),i="content-box"===r.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight):"hidden"!==r.overflowY&&(t("hidden"),o(),i="content-box"===r.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight),l!==i){l=i;var s=d("autosize:resized");try{e.dispatchEvent(s)}catch(e){}}}if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!i.has(e)){var s=null,u=e.clientWidth,l=null,a=function(){e.clientWidth!==u&&r()},c=function t(){window.removeEventListener("resize",a,!1),e.removeEventListener("input",r,!1),e.removeEventListener("keyup",r,!1),e.removeEventListener("autosize:destroy",t,!1),e.removeEventListener("autosize:update",r,!1),i.delete(e)};e.addEventListener("autosize:destroy",c,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",r,!1),window.addEventListener("resize",a,!1),e.addEventListener("input",r,!1),e.addEventListener("autosize:update",r,!1),e.style.overflowX="hidden",e.style.wordWrap="break-word",i.set(e,{destroy:c,update:r}),function(){var t=this,n=window.getComputedStyle(e,null);"both"===n.resize&&(e.style.resize="vertical"),s="content-box"===n.boxSizing?-(parseFloat(n.paddingTop)+parseFloat(n.paddingBottom)):parseFloat(n.borderTopWidth)+parseFloat(n.borderBottomWidth),isNaN(s)&&(s=0);var o=function n(){var o=["overflow","overflow-wrap","overflowX","overflowY","wordWrap"],r=e.style["max-height"];e.style.height=e.offsetHeight+"px",e.style["max-height"]="none",e.setAttribute("user-resized",1);var i=e.clientHeight,d=!1,s=function t(){e.clientHeight!==i&&(r="none",e.removeEventListener("mousemove",t),e.removeEventListener("mousedown",n),c(e),d=!0)};e.addEventListener("mousemove",s),e.addEventListener("mouseup",function(){e.style["max-height"]=r,d&&o.forEach(function(t){e.style[t]=""}),e.removeEventListener("mouseup",t),e.removeEventListener("mousemove",s)})};e.addEventListener("mousedown",o),r()}()}}function o(e){var t=i.get(e);t&&t.destroy()}function r(e){var t=i.get(e);t&&t.update()}var i="function"==typeof Map?new Map:function(){var e=[],t=[];return{has:function(t){return e.indexOf(t)>-1},get:function(n){return t[e.indexOf(n)]},set:function(n,o){-1===e.indexOf(n)&&(e.push(n),t.push(o))},delete:function(n){var o=e.indexOf(n);o>-1&&(e.splice(o,1),t.splice(o,1))}}}(),d=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){d=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}var s=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?(s=function(e){return e},s.destroy=function(e){return e},s.update=function(e){return e}):(s=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],function(e){return n(e)}),e},s.destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],o),e},s.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],r),e}),t.exports=s});
diff --git a/extensions/BugModal/web/bug_modal.css b/extensions/BugModal/web/bug_modal.css
index 44496c333..36e556efe 100644
--- a/extensions/BugModal/web/bug_modal.css
+++ b/extensions/BugModal/web/bug_modal.css
@@ -715,6 +715,7 @@ body.platform-Win32 .comment-text, body.platform-Win64 .comment-text {
margin: 0 0 1em;
max-width: 1024px;
max-height: 400px;
+ resize: vertical;
}
#comment-preview {