Commit b185941b authored by Gabriel Mazetto's avatar Gabriel Mazetto

More codestyle changes for haml and ES6

parent aa074632
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
/*= require shortcuts_network */ /*= require shortcuts_network */
/*= require jquery.nicescroll */ /*= require jquery.nicescroll */
/*= require date.format */ /*= require date.format */
/*= require geo/geo_bundle */
/*= require_directory ./behaviors */ /*= require_directory ./behaviors */
/*= require_directory ./blob */ /*= require_directory ./blob */
/*= require_directory ./templates */ /*= require_directory ./templates */
......
//= require vue
/* global modal Vue */ /* global modal Vue */
(() => { (() => {
Vue.component('geo-clone-dialog', { window.gl = window.gl || {};
name: 'geo-clone-dialog', window.gl.geo = window.gl.geo || {};
window.gl.geo.CloneDialog = Vue.extend({
props: ['title', 'id'], props: ['title', 'id'],
data() { data() {
return this.$parent.$data; return this.$parent.$data;
...@@ -33,14 +34,4 @@ ...@@ -33,14 +34,4 @@
</div> </div>
`, `,
}); });
})();
$(document).ready(() => {
const geoClone = document.getElementById('geo-clone');
if (geoClone) {
gl.GeoCloneDialog = new Vue({
el: geoClone,
data: Object.assign({}, geoClone.dataset),
});
}
});
})(window.gl || (window.gl = {}));
/* global modal Vue */
//= require vue
//= require ./components/geo_clone_dialog
$(document).ready(() => {
window.gl = window.gl || {};
const $geoClone = document.getElementById('geo-clone');
if ($geoClone) {
gl.GeoClone = new Vue({
el: $geoClone,
components: {
'geo-clone-dialog': gl.geo.CloneDialog,
},
data: Object.assign({}, $geoClone.dataset),
});
}
});
...@@ -38,9 +38,9 @@ ...@@ -38,9 +38,9 @@
e.preventDefault(); e.preventDefault();
var $this = $(this); var $this = $(this);
if (gl.GeoCloneDialog) { if (gl.GeoClone) {
gl.GeoCloneDialog.cloneUrlSecondary = $this.attr('href'); gl.GeoClone.cloneUrlSecondary = $this.attr('href');
gl.GeoCloneDialog.cloneUrlPrimary = $this.data('primaryUrl'); gl.GeoClone.cloneUrlPrimary = $this.data('primaryUrl');
} }
}); });
......
#geo-clone{data: {clone_url_secondary: h(default_url_to_repo(project)), clone_url_primary: h(geo_primary_default_url_to_repo(project))}} #geo-clone{ data: { clone_url_secondary: h(default_url_to_repo(project)), clone_url_primary: h(geo_primary_default_url_to_repo(project)) } }
%geo-clone-dialog{id: 'modal-geo-info', title: 'How to work faster with Geo'} %geo-clone-dialog{ id: 'modal-geo-info', title: 'How to work faster with Geo' }
%span{slot: 'clipboard-1'} %span{ slot: 'clipboard-1' }
= clipboard_button(clipboard_target: 'pre#geo-info-1') = clipboard_button(clipboard_target: 'pre#geo-info-1')
%span{slot: 'clipboard-2'} %span{ slot: 'clipboard-2' }
= clipboard_button(clipboard_target: 'pre#geo-info-2') = clipboard_button(clipboard_target: 'pre#geo-info-2')
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment