This repository has been archived by the owner on Mar 14, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Not quite working. jquery-ui draggable isn't working.
- Loading branch information
Showing
11 changed files
with
187 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ | |
"jquery": "^3.1.1", | ||
"laravel-mix": "0.*", | ||
"lodash": "^4.17.4", | ||
"gridstack": "^0.3.0", | ||
"vue": "^2.1.10" | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<!--[if lt IE 9]> | ||
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> | ||
<![endif]--> | ||
|
||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<meta name="csrf-token" content="{{ csrf_token() }}"> | ||
<title>Float grid demo</title> | ||
|
||
<link rel="stylesheet" href="{{ mix('/css/vendor.css') }}"> | ||
<link rel="stylesheet" href="{{ mix('/css/app.css') }}"> | ||
{{--<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">--}} | ||
{{--<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/gridstack.js/0.3.0/gridstack.min.css"/>--}} | ||
|
||
{{--<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>--}} | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.0/jquery-ui.js"></script> | ||
{{--<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>--}} | ||
{{--<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.5.0/lodash.min.js"></script>--}} | ||
{{--<script src="https://cdnjs.cloudflare.com/ajax/libs/gridstack.js/0.3.0/gridstack.min.js"></script>--}} | ||
{{--<script src="https://cdnjs.cloudflare.com/ajax/libs/gridstack.js/0.3.0/gridstack.jQueryUI.min.js"></script>--}} | ||
<script src="{{ mix('/js/manifest.js') }}"></script> | ||
<script src="{{ mix('/js/vendor.js') }}"></script> | ||
<script src="{{ mix('/js/app.js') }}"></script> | ||
|
||
|
||
<style type="text/css"> | ||
.grid-stack { | ||
background: lightgoldenrodyellow; | ||
} | ||
.grid-stack-item-content { | ||
color: #2c3e50; | ||
text-align: center; | ||
background-color: #18bc9c; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div class="container-fluid"> | ||
<h1>Float grid demo</h1> | ||
|
||
<div> | ||
<a class="btn btn-default" id="add-new-widget" href="#">Add Widget</a> | ||
</div> | ||
|
||
<br/> | ||
|
||
<div class="grid-stack"> | ||
</div> | ||
</div> | ||
|
||
|
||
<script type="text/javascript"> | ||
$(function () { | ||
var options = { | ||
float: true | ||
}; | ||
$('.grid-stack').gridstack(options); | ||
new function () { | ||
this.items = [ | ||
{x: 0, y: 0, width: 2, height: 2}, | ||
{x: 3, y: 1, width: 1, height: 2}, | ||
{x: 4, y: 1, width: 1, height: 1}, | ||
{x: 2, y: 3, width: 3, height: 1}, | ||
// {x: 1, y: 4, width: 1, height: 1}, | ||
// {x: 1, y: 3, width: 1, height: 1}, | ||
// {x: 2, y: 4, width: 1, height: 1}, | ||
{x: 2, y: 5, width: 1, height: 1} | ||
]; | ||
this.grid = $('.grid-stack').data('gridstack'); | ||
this.addNewWidget = function () { | ||
var node = this.items.pop() || { | ||
x: 12 * Math.random(), | ||
y: 5 * Math.random(), | ||
width: 1 + 3 * Math.random(), | ||
height: 1 + 3 * Math.random() | ||
}; | ||
this.grid.addWidget($('<div><div class="grid-stack-item-content" /><div/>'), | ||
node.x, node.y, node.width, node.height); | ||
return false; | ||
}.bind(this); | ||
$('#add-new-widget').click(this.addNewWidget); | ||
}; | ||
}); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,71 @@ | ||
@extends('layouts.app') | ||
|
||
@section('content') | ||
|
||
<div id="app"><!-- include this in app layout? --> | ||
<example></example> | ||
</div> | ||
|
||
|
||
<h1>Gridstack.js and Vue.js</h1> | ||
|
||
{{--https://troolee.github.io/gridstack.js/--}} | ||
<div class="grid-stack" id="app2"> | ||
|
||
<dashboard-widget v-for="widget in widgetsList" v-bind:widget="widget"></dashboard-widget> | ||
|
||
</div> | ||
|
||
|
||
</div> | ||
|
||
|
||
|
||
|
||
@endsection | ||
|
||
@section('pagejs') | ||
@parent | ||
{{--$.fn.size = function(){--}} | ||
{{--return this.length;--}} | ||
{{--};--}} | ||
{{--<script src="{{ url('js/lodash.min.js') }}"></script>--}} | ||
{{--<script src="{{ url('js/gridstack.min.js') }}"></script>--}} | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.0/jquery-ui.js"></script> | ||
|
||
<script type="text/javascript"> | ||
/*Gridstack*/ | ||
$(function () { | ||
var options = { | ||
cellHeight: 80, | ||
verticalMargin: 10 | ||
}; | ||
$('.grid-stack').gridstack(options); | ||
}); | ||
// $('.grid-stack').gridstack({ | ||
// cellHeight: 80, | ||
// verticalMargin: 10, | ||
// draggable: { | ||
// handle: '.draggable', | ||
// scroll: true, | ||
// appendTo: 'body' | ||
// }, | ||
// animate: true | ||
// }); | ||
var app2 = new Vue({ | ||
el: '#app2', | ||
data: { | ||
widgetsList: [ | ||
{text: 'Vegetables', width: '2', height: '2', title: 'one'}, | ||
{text: 'Cheese', width: '2', height: '4', title: 'two'}, | ||
{text: 'Whatever else humans are supposed to eat', width: '4', height: '2', title: 'three'} | ||
] | ||
} | ||
}) | ||
</script> | ||
|
||
@endsection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters